I added a moving platform. Tutorial is finished. So now the player is on their own.
This commit is contained in:
@@ -32,8 +32,6 @@ func _on_area_2d_body_entered(body: Node2D) -> void:
|
||||
animated_sprite_2d.animation = "idle"
|
||||
animated_sprite_2d.flip_h = !animated_sprite_2d.flip_h
|
||||
wait_timer.start()
|
||||
print(body)
|
||||
|
||||
|
||||
func _on_wait_timer_timeout() -> void:
|
||||
if !alive:
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
extends Control
|
||||
|
||||
@onready var snail_killer: Label = $SnailKiller
|
||||
|
||||
func _ready() -> void:
|
||||
snail_killer.visible = false
|
||||
|
||||
func _on_area_2d_body_entered(body: Node2D) -> void:
|
||||
snail_killer.visible = true
|
||||
@@ -0,0 +1 @@
|
||||
uid://b4glijhmo7xu1
|
||||
+197
-2
File diff suppressed because one or more lines are too long
@@ -1,16 +1,16 @@
|
||||
[gd_scene format=3 uid="uid://dcq87880d84d1"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bi0huapp06d5d" path="res://main.gd" id="1_1bvp3"]
|
||||
[ext_resource type="Texture2D" uid="uid://ubufodpe3ggi" path="res://assets/images/Background/Blue.png" id="1_h2yge"]
|
||||
[ext_resource type="Texture2D" uid="uid://wo2j88hipv73" path="res://assets/images/Background/Green.png" id="2_0xm2m"]
|
||||
|
||||
[node name="Main" type="Node2D" unique_id=49659626]
|
||||
script = ExtResource("1_1bvp3")
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="." unique_id=1615112427]
|
||||
texture_filter = 1
|
||||
offset_left = -2297.0
|
||||
offset_top = -87190.0
|
||||
offset_right = 87703.0
|
||||
offset_bottom = 2810.0
|
||||
texture = ExtResource("1_h2yge")
|
||||
offset_left = -109510.0
|
||||
offset_top = -102336.0
|
||||
offset_right = 790490.0
|
||||
offset_bottom = 797664.0
|
||||
texture = ExtResource("2_0xm2m")
|
||||
stretch_mode = 1
|
||||
|
||||
@@ -11,6 +11,9 @@ const JUMP_VELOCITY = -850.0
|
||||
var alive = true
|
||||
var can_move = true
|
||||
|
||||
func _ready() -> void:
|
||||
floor_snap_length = 12
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
if !alive:
|
||||
return
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
extends TileMapLayer
|
||||
|
||||
var moving_up :bool = true
|
||||
var speed :float = 50.0
|
||||
var distance_moved :float = 0.0
|
||||
var moving = false
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta: float) -> void:
|
||||
if moving:
|
||||
var movement = speed * delta
|
||||
|
||||
if moving_up:
|
||||
position.y -= movement
|
||||
distance_moved += movement
|
||||
if distance_moved >= 479.7:
|
||||
moving_up = false
|
||||
|
||||
|
||||
func _on_platform_body_entered(body: Node2D) -> void:
|
||||
print(body)
|
||||
moving = true
|
||||
@@ -0,0 +1 @@
|
||||
uid://c07aik54vwpiv
|
||||
Reference in New Issue
Block a user