initial moving giraffe head and tree

master
troido 2021-02-06 20:50:01 +01:00
parent 23fd1ec519
commit ea21ddf9f3
10 changed files with 137 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 513 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/giraffe_head.png-54af3d9430172b37967e6a57a8c3275d.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Assets/giraffe_head.png"
dest_files=[ "res://.import/giraffe_head.png-54af3d9430172b37967e6a57a8c3275d.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

BIN
Assets/tree.png 100644

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/tree.png-f0858fcddf0a23aa79accde76137cff6.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Assets/tree.png"
dest_files=[ "res://.import/tree.png-f0858fcddf0a23aa79accde76137cff6.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

View File

@ -0,0 +1,15 @@
[gd_scene load_steps=4 format=2]
[ext_resource path="res://Assets/giraffe_head.png" type="Texture" id=1]
[ext_resource path="res://Scripts/GiraffeHead.gd" type="Script" id=2]
[sub_resource type="RectangleShape2D" id=1]
[node name="GiraffeHead" type="KinematicBody2D"]
script = ExtResource( 2 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource( 1 )
[node name="Sprite" type="Sprite" parent="."]
texture = ExtResource( 1 )

8
Scenes/Tree.tscn 100644
View File

@ -0,0 +1,8 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://Assets/tree.png" type="Texture" id=1]
[node name="Tree" type="Node2D"]
[node name="Sprite" type="Sprite" parent="."]
texture = ExtResource( 1 )

12
Scenes/World.tscn 100644
View File

@ -0,0 +1,12 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://Scenes/GiraffeHead.tscn" type="PackedScene" id=1]
[ext_resource path="res://Scenes/Tree.tscn" type="PackedScene" id=2]
[node name="World" type="Node2D"]
[node name="GiraffeHead" parent="." instance=ExtResource( 1 )]
position = Vector2( 362.448, 402.091 )
[node name="Tree" parent="." instance=ExtResource( 2 )]
position = Vector2( 118.928, 186.887 )

View File

@ -0,0 +1,14 @@
extends KinematicBody2D
export var speed = 50
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
func _physics_process(delta):
var input_movement = int(Input.is_action_pressed("right")) - int(Input.is_action_pressed("left"))
self.move_and_slide(Vector2(input_movement * speed, 0), Vector2(0, -1))

View File

@ -1,5 +1,7 @@
[gd_resource type="Environment" load_steps=2 format=2]
[sub_resource type="ProceduralSky" id=1]
[resource]
background_mode = 2
background_sky = SubResource( 1 )

View File

@ -16,8 +16,26 @@ _global_script_class_icons={
[application]
config/name="giraffesnake"
run/main_scene="res://Scenes/World.tscn"
config/icon="res://icon.png"
[input]
left={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777231,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":65,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":72,"unicode":0,"echo":false,"script":null)
]
}
right={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777233,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":68,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":76,"unicode":0,"echo":false,"script":null)
]
}
[rendering]
quality/driver/driver_name="GLES2"