1
Fork 0
mirror of https://github.com/Steffo99/watermelonkeys-patched-ld51.git synced 2024-10-16 06:17:34 +00:00

night make u ded

This commit is contained in:
AndreaTerenz 2022-10-03 18:46:46 +02:00
parent 9e83e1a489
commit af8f256571
7 changed files with 137 additions and 160 deletions

View file

@ -1,7 +1,6 @@
[gd_scene load_steps=4 format=2]
[gd_scene load_steps=3 format=2]
[ext_resource path="res://brick_tileset.tres" type="TileSet" id=1]
[ext_resource path="res://Giovanna.tscn" type="PackedScene" id=2]
[ext_resource path="res://enemies/Enemy.tscn" type="PackedScene" id=3]
[node name="Node2D" type="Node2D"]
@ -12,8 +11,5 @@ cell_size = Vector2( 16, 16 )
format = 1
tile_data = PoolIntArray( 0, 0, 0, 1, 0, 0, 2, 0, 0, 3, 0, 0, 4, 0, 0, 5, 0, 0, 6, 0, 0, 7, 0, 0, 8, 0, 0, 9, 0, 0, 10, 0, 0, 11, 0, 0, 12, 0, 0, 13, 0, 0, 14, 0, 0, 15, 0, 0, 16, 0, 0, 17, 0, 0, 18, 0, 0, 19, 0, 0, 20, 0, 0, 21, 0, 0, 22, 0, 0, 23, 0, 0, 24, 0, 0, 25, 0, 0, 26, 0, 0, 27, 0, 0, 28, 0, 0, 29, 0, 0, 65536, 0, 0, 65565, 0, 0, 131072, 0, 0, 131101, 0, 0, 196608, 0, 0, 196637, 0, 0, 262144, 0, 0, 262173, 0, 0, 327680, 0, 0, 327698, 0, 0, 327699, 0, 0, 327700, 0, 0, 327701, 0, 0, 327702, 0, 0, 327703, 0, 0, 327704, 0, 0, 327705, 0, 0, 327706, 0, 0, 327707, 0, 0, 327708, 0, 0, 327709, 0, 0, 393216, 0, 0, 393245, 0, 0, 458752, 0, 0, 458781, 0, 0, 524288, 0, 0, 524317, 0, 0, 589824, 0, 0, 589841, 0, 0, 589842, 0, 0, 589843, 0, 0, 589844, 0, 0, 589845, 0, 0, 589846, 0, 0, 589847, 0, 0, 589848, 0, 0, 589849, 0, 0, 589853, 0, 0, 655360, 0, 0, 655377, 0, 0, 655389, 0, 0, 720896, 0, 0, 720913, 0, 0, 720925, 0, 0, 786432, 0, 0, 786436, 0, 0, 786437, 0, 0, 786438, 0, 0, 786439, 0, 0, 786440, 0, 0, 786441, 0, 0, 786442, 0, 0, 786443, 0, 0, 786444, 0, 0, 786449, 0, 0, 786461, 0, 0, 851968, 0, 0, 851972, 0, 0, 851973, 0, 0, 851974, 0, 0, 851975, 0, 0, 851976, 0, 0, 851977, 0, 0, 851978, 0, 0, 851979, 0, 0, 851980, 0, 0, 851997, 0, 0, 917504, 0, 0, 917533, 0, 0, 983040, 0, 0, 983069, 0, 0, 1048576, 0, 0, 1048577, 0, 0, 1048578, 0, 0, 1048579, 0, 0, 1048580, 0, 0, 1048581, 0, 0, 1048582, 0, 0, 1048583, 0, 0, 1048584, 0, 0, 1048585, 0, 0, 1048586, 0, 0, 1048587, 0, 0, 1048588, 0, 0, 1048589, 0, 0, 1048590, 0, 0, 1048591, 0, 0, 1048592, 0, 0, 1048593, 0, 0, 1048594, 0, 0, 1048595, 0, 0, 1048596, 0, 0, 1048597, 0, 0, 1048598, 0, 0, 1048599, 0, 0, 1048600, 0, 0, 1048601, 0, 0, 1048602, 0, 0, 1048603, 0, 0, 1048604, 0, 0, 1048605, 0, 0 )
[node name="Giovanna" parent="." instance=ExtResource( 2 )]
position = Vector2( 247, 139 )
[node name="Enemy" parent="." instance=ExtResource( 3 )]
position = Vector2( 121, 42 )

View file

@ -1,36 +0,0 @@
class_name Giovanna
extends KinematicBody2D
export(float, 0.01, 2.0, 0.01) var stopping_force = 1.0
var ammo = 6
var velocity = Vector2(0,0)
const max_speed = 150
const GRAVITY = 30
const JUMPFORCE = -500
func _ready():
owner.set_meta("player", self)
func _physics_process(delta):
if Input.is_action_pressed("right"):
velocity.x = max_speed
$AnimatedSprite.play("walk")
$AnimatedSprite.flip_h = true
elif Input.is_action_pressed("left"):
velocity.x = -max_speed
$AnimatedSprite.play("walk")
$AnimatedSprite.flip_h = false
else:
$AnimatedSprite.play("idle")
if not is_on_floor():
$AnimatedSprite.play("air")
velocity.y = velocity.y + GRAVITY
if Input.is_action_just_pressed("jump") and is_on_floor():
velocity.y = JUMPFORCE
velocity = move_and_slide(velocity,Vector2.UP)
velocity.x = lerp(velocity.x,0,stopping_force)

View file

@ -1,21 +1,99 @@
[gd_scene load_steps=4 format=2]
[gd_scene load_steps=7 format=2]
[ext_resource path="res://Giovanna.tres" type="SpriteFrames" id=1]
[ext_resource path="res://Giovanna.gd" type="Script" id=2]
[ext_resource path="res://platformer_controller/giovanna.gd" type="Script" id=1]
[ext_resource path="res://Giovanna.tres" type="SpriteFrames" id=2]
[ext_resource path="res://assets/sounds/salto1.wav" type="AudioStream" id=3]
[sub_resource type="CapsuleShape2D" id=1]
radius = 5.0
[sub_resource type="RectangleShape2D" id=4]
extents = Vector2( 7, 15 )
[sub_resource type="GDScript" id=14]
script/source = "extends Node2D
onready var ded_timer = $DedTimer
var health := 100.0
var is_night := false
var in_light := false
func _ready():
print(\"In light: %s\" % in_light)
func _process(delta):
if is_night:
if not in_light and ded_timer.is_stopped():
ded_timer.start(0.4)
func _on_LightCheck_entered(area):
in_light = true
# print(\"In light: %s\" % in_light)
func _on_LightCheck_exited(area):
in_light = false
# print(\"In light: %s\" % in_light)
func _on_DedTimer_timeout():
get_tree().change_scene(\"res://Dead.tscn\")
func _on_level_day():
is_night = false
func _on_level_night():
is_night = true
"
[sub_resource type="RectangleShape2D" id=16]
extents = Vector2( 9, 15 )
[node name="Giovanna" type="KinematicBody2D"]
z_index = 1
script = ExtResource( 2 )
script = ExtResource( 1 )
[node name="AnimatedSprite" type="AnimatedSprite" parent="."]
frames = ExtResource( 2 )
animation = "air"
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource( 4 )
[node name="Jump_AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 3 )
volume_db = -28.614
[node name="Camera2D" type="Camera2D" parent="."]
offset = Vector2( 0, -48 )
current = true
limit_left = -129
limit_top = -217
limit_right = 1123
limit_bottom = 669
limit_smoothed = true
smoothing_enabled = true
editor_draw_limits = true
[node name="PlayerStatus" type="Node2D" parent="."]
script = SubResource( 14 )
__meta__ = {
"_edit_group_": true
}
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource( 1 )
[node name="LightCheck" type="Area2D" parent="PlayerStatus"]
collision_mask = 2
[node name="AnimatedSprite" type="AnimatedSprite" parent="."]
frames = ExtResource( 1 )
animation = "air"
[node name="CollisionShape2D" type="CollisionShape2D" parent="PlayerStatus/LightCheck"]
shape = SubResource( 4 )
[node name="DedTimer" type="Timer" parent="PlayerStatus"]
[node name="WallJump_Area2D" type="Area2D" parent="."]
[node name="CollisionShape2D" type="CollisionShape2D" parent="WallJump_Area2D"]
shape = SubResource( 16 )
[connection signal="level_day" from="." to="PlayerStatus" method="_on_level_day"]
[connection signal="level_night" from="." to="PlayerStatus" method="_on_level_night"]
[connection signal="area_entered" from="PlayerStatus/LightCheck" to="PlayerStatus" method="_on_LightCheck_entered"]
[connection signal="area_exited" from="PlayerStatus/LightCheck" to="PlayerStatus" method="_on_LightCheck_exited"]
[connection signal="timeout" from="PlayerStatus/DedTimer" to="PlayerStatus" method="_on_DedTimer_timeout"]

View file

@ -1,7 +1,7 @@
[gd_scene load_steps=12 format=2]
[ext_resource path="res://light.tscn" type="PackedScene" id=1]
[ext_resource path="res://Player.tscn" type="PackedScene" id=2]
[ext_resource path="res://Giovanna.tscn" type="PackedScene" id=2]
[ext_resource path="res://brick_tileset.tres" type="TileSet" id=3]
[ext_resource path="res://ASSETS/Background/Layer 7.png" type="Texture" id=4]
[ext_resource path="res://ASSETS/Background/Skyline2.png" type="Texture" id=5]
@ -11,9 +11,16 @@
[sub_resource type="GDScript" id=3]
script/source = "extends Node2D
signal day
signal night
onready var layer_1 = $ParallaxBackground/ParallaxLayer2
onready var layer_2 = $\"ParallaxBackground/Purple Sky\"
onready var layer_3 = $ParallaxBackground/ParallaxLayer
onready var sun_sprite = $ParallaxBackground/ParallaxLayer2/Sun
func _ready():
emit_signal(\"day\")
func _input(event):
if Input.is_action_just_pressed(\"quit\"):
@ -25,7 +32,26 @@ func _on_sun_anim_done():
tween.tween_property(layer_1, \"modulate\", Color.black, 0.3)
tween.tween_property(layer_2, \"modulate\", Color.black, 0.3).set_delay(0.1)
tween.tween_property(layer_3, \"modulate\", Color.black, 0.3).set_delay(0.1)
yield(tween, \"finished\")
emit_signal(\"night\")
yield(get_tree().create_timer(10.0), \"timeout\")
fade_back_in()
func fade_back_in():
sun_sprite.animate()
var tween = create_tween()
tween.set_parallel()
tween.tween_property(layer_3, \"modulate\", Color.white, 0.3)
tween.tween_property(layer_2, \"modulate\", Color.white, 0.3).set_delay(0.1)
tween.tween_property(layer_1, \"modulate\", Color.white, 0.3).set_delay(0.1)
yield(tween, \"finished\")
emit_signal(\"day\")
func _on_DeathZone_body_entered(body):
get_tree().change_scene(\"res://Dead.tscn\")

View file

@ -1,96 +0,0 @@
[gd_scene load_steps=7 format=2]
[ext_resource path="res://platformer_controller/platformer_controller.gd" type="Script" id=1]
[ext_resource path="res://Giovanna.tres" type="SpriteFrames" id=2]
[ext_resource path="res://assets/sounds/salto1.wav" type="AudioStream" id=3]
[sub_resource type="RectangleShape2D" id=4]
extents = Vector2( 7, 15 )
[sub_resource type="GDScript" id=14]
script/source = "extends Node2D
onready var ded_timer = $DedTimer
var health := 100.0
var is_night := false
var in_light := false
func _ready():
print(\"In light: %s\" % in_light)
func _process(delta):
pass
if is_night:
if not in_light and ded_timer.is_stopped():
ded_timer.start(0.4)
func _on_LightCheck_entered(area):
in_light = true
# print(\"In light: %s\" % in_light)
func _on_LightCheck_exited(area):
in_light = false
# print(\"In light: %s\" % in_light)
func _on_cycle_started(i_n):
is_night = i_n
func _on_DedTimer_timeout():
get_tree().reload_current_scene()
"
[sub_resource type="RectangleShape2D" id=16]
extents = Vector2( 9, 15 )
[node name="PlatformerController2D" type="KinematicBody2D"]
script = ExtResource( 1 )
[node name="AnimatedSprite" type="AnimatedSprite" parent="."]
frames = ExtResource( 2 )
animation = "air"
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource( 4 )
[node name="Jump_AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 3 )
volume_db = -28.614
[node name="Camera2D" type="Camera2D" parent="."]
offset = Vector2( 0, -48 )
current = true
limit_left = -129
limit_top = -217
limit_right = 1123
limit_bottom = 669
limit_smoothed = true
smoothing_enabled = true
editor_draw_limits = true
[node name="PlayerStatus" type="Node2D" parent="."]
script = SubResource( 14 )
__meta__ = {
"_edit_group_": true
}
[node name="LightCheck" type="Area2D" parent="PlayerStatus"]
collision_mask = 2
[node name="CollisionShape2D" type="CollisionShape2D" parent="PlayerStatus/LightCheck"]
shape = SubResource( 4 )
[node name="DedTimer" type="Timer" parent="PlayerStatus"]
[node name="WallJump_Area2D" type="Area2D" parent="."]
[node name="CollisionShape2D" type="CollisionShape2D" parent="WallJump_Area2D"]
shape = SubResource( 16 )
[connection signal="area_entered" from="PlayerStatus/LightCheck" to="PlayerStatus" method="_on_LightCheck_entered"]
[connection signal="area_exited" from="PlayerStatus/LightCheck" to="PlayerStatus" method="_on_LightCheck_exited"]
[connection signal="timeout" from="PlayerStatus/DedTimer" to="PlayerStatus" method="_on_DedTimer_timeout"]

View file

@ -1,6 +1,9 @@
extends KinematicBody2D
class_name PlatformerController2D
signal level_day
signal level_night
class_name Giovanna
# Set these to the name of your action (in the Input Map)
export var input_left : String = "left"
@ -71,6 +74,13 @@ func _init():
func _ready():
owner.set_meta("player", self)
if owner.has_signal("day"):
owner.connect("day", self, "_on_day")
if owner.has_signal("night"):
owner.connect("night", self, "_on_night")
add_child(coyote_timer)
coyote_timer.wait_time = coyote_time
coyote_timer.one_shot = true
@ -85,6 +95,11 @@ func _ready():
owner.set_meta("player", self)
func _on_day():
emit_signal("level_day")
func _on_night():
emit_signal("level_night")
func _physics_process(delta):
acc.x = 0

View file

@ -17,17 +17,11 @@ _global_script_classes=[ {
"base": "KinematicBody2D",
"class": "Giovanna",
"language": "GDScript",
"path": "res://Giovanna.gd"
}, {
"base": "KinematicBody2D",
"class": "PlatformerController2D",
"language": "GDScript",
"path": "res://platformer_controller/platformer_controller.gd"
"path": "res://platformer_controller/giovanna.gd"
} ]
_global_script_class_icons={
"Enemy": "",
"Giovanna": "",
"PlatformerController2D": ""
"Giovanna": ""
}
[application]