Compare commits

..

No commits in common. "nihilazo" and "master" have entirely different histories.

12 changed files with 13 additions and 168 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

View File

@ -1,34 +0,0 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/bare_tree.png-8e3f706bd49c6629bd8ef416386571ce.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/bare_tree.png"
dest_files=[ "res://.import/bare_tree.png-8e3f706bd49c6629bd8ef416386571ce.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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

After

Width:  |  Height:  |  Size: 513 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -19,12 +19,6 @@ config/name="giraffesnake"
run/main_scene="res://scenes/World.tscn" run/main_scene="res://scenes/World.tscn"
config/icon="res://icon.png" config/icon="res://icon.png"
[display]
window/size/width=1920
window/size/height=1080
window/stretch/mode="2d"
[input] [input]
left={ left={

View File

@ -1,35 +0,0 @@
[gd_scene format=2]
[node name="DeathScreen" type="PopupPanel"]
pause_mode = 2
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -960.0
margin_top = -540.0
margin_right = 960.0
margin_bottom = 540.0
popup_exclusive = true
[node name="Box" type="VBoxContainer" parent="."]
margin_right = 40.0
margin_bottom = 40.0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Header" type="Label" parent="Box"]
margin_right = 61.0
margin_bottom = 31.0
text = "You Died!
"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Score" type="Label" parent="Box"]
margin_top = 35.0
margin_right = 61.0
margin_bottom = 49.0
text = "Score: "

View File

@ -3,15 +3,12 @@
[ext_resource path="res://assets/giraffe_head.png" type="Texture" id=1] [ext_resource path="res://assets/giraffe_head.png" type="Texture" id=1]
[ext_resource path="res://scripts/GiraffeHead.gd" type="Script" id=2] [ext_resource path="res://scripts/GiraffeHead.gd" type="Script" id=2]
[sub_resource type="CapsuleShape2D" id=1] [sub_resource type="RectangleShape2D" id=1]
radius = 39.8424
height = 10.5097
[node name="GiraffeHead" type="KinematicBody2D"] [node name="GiraffeHead" type="KinematicBody2D"]
script = ExtResource( 2 ) script = ExtResource( 2 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="."] [node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2( 9.54593, -0.353554 )
shape = SubResource( 1 ) shape = SubResource( 1 )
[node name="Sprite" type="Sprite" parent="."] [node name="Sprite" type="Sprite" parent="."]

View File

@ -1,33 +1,8 @@
[gd_scene load_steps=7 format=2] [gd_scene load_steps=2 format=2]
[ext_resource path="res://assets/tree.png" type="Texture" id=1] [ext_resource path="res://assets/tree.png" type="Texture" id=1]
[ext_resource path="res://scripts/Tree.gd" type="Script" id=2]
[ext_resource path="res://assets/bare_tree.png" type="Texture" id=3]
[sub_resource type="SpriteFrames" id=1] [node name="Tree" type="Node2D"]
animations = [ {
"frames": [ ExtResource( 1 ), ExtResource( 3 ) ],
"loop": true,
"name": "default",
"speed": 5.0
} ]
[sub_resource type="RectangleShape2D" id=2] [node name="Sprite" type="Sprite" parent="."]
extents = Vector2( 112.784, 53.9413 ) texture = ExtResource( 1 )
[sub_resource type="RectangleShape2D" id=3]
extents = Vector2( 50.4981, 83.1256 )
[node name="Tree" type="KinematicBody2D"]
script = ExtResource( 2 )
[node name="Sprite" type="AnimatedSprite" parent="."]
frames = SubResource( 1 )
[node name="Leaves" type="CollisionShape2D" parent="."]
position = Vector2( 0.629959, -28.6632 )
shape = SubResource( 2 )
[node name="Trunk" type="CollisionShape2D" parent="."]
position = Vector2( -57.0114, 4.03472 )
shape = SubResource( 3 )

View File

@ -1,23 +1,12 @@
[gd_scene load_steps=5 format=2] [gd_scene load_steps=3 format=2]
[ext_resource path="res://scenes/GiraffeHead.tscn" type="PackedScene" id=1] [ext_resource path="res://scenes/GiraffeHead.tscn" type="PackedScene" id=1]
[ext_resource path="res://scenes/Tree.tscn" type="PackedScene" id=2] [ext_resource path="res://scenes/Tree.tscn" type="PackedScene" id=2]
[ext_resource path="res://scripts/World.gd" type="Script" id=3]
[ext_resource path="res://scenes/DeathScreen.tscn" type="PackedScene" id=4]
[node name="World" type="Node2D"] [node name="World" type="Node2D"]
script = ExtResource( 3 )
[node name="GiraffeHead" parent="." instance=ExtResource( 1 )] [node name="GiraffeHead" parent="." instance=ExtResource( 1 )]
position = Vector2( 1089.79, 940.571 ) position = Vector2( 362.448, 402.091 )
[node name="Tree" parent="." instance=ExtResource( 2 )] [node name="Tree" parent="." instance=ExtResource( 2 )]
position = Vector2( 748, 463.862 ) position = Vector2( 118.928, 186.887 )
[node name="DeathScreen" parent="." instance=ExtResource( 4 )]
margin_left = 820.184
margin_top = 537.476
margin_right = 889.184
margin_bottom = 594.476
[connection signal="death" from="Tree" to="." method="_on_Tree_death"]
[connection signal="eaten" from="Tree" to="." method="_on_Tree_eaten"]

View File

@ -1,6 +1,6 @@
extends KinematicBody2D extends KinematicBody2D
export var speed = 5 export var speed = 50
# Called when the node enters the scene tree for the first time. # Called when the node enters the scene tree for the first time.
@ -8,9 +8,7 @@ func _ready():
pass # Replace with function body. pass # Replace with function body.
func _physics_process(delta): func _physics_process(delta):
if Input.is_action_pressed("right"): var input_movement = int(Input.is_action_pressed("right")) - int(Input.is_action_pressed("left"))
self.move_and_collide(Vector2(speed,0))
$Sprite.flip_h = true
elif Input.is_action_pressed("left"): self.move_and_slide(Vector2(input_movement * speed, 0), Vector2(0, -1))
$Sprite.flip_h = false
self.move_and_collide(Vector2(-speed,0))

View File

@ -1,18 +0,0 @@
extends KinematicBody2D
signal death
signal eaten
onready var speed = 1
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
set_physics_process(true)
func _physics_process(delta):
var col = self.move_and_collide(Vector2(0,speed))
if col != null and col.local_shape == $Leaves:
$Sprite.frame = 1
emit_signal("eaten")
$Leaves.disabled = true
elif col != null and col.local_shape == $Trunk:
emit_signal("death")

View File

@ -1,21 +0,0 @@
extends Node2D
var score = 0
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass
func _on_Tree_eaten():
score += 1
func _on_Tree_death():
get_tree().paused = true
$DeathScreen/Box/Score.text = "Score: " + str(score)
$DeathScreen.popup_centered()