Added in additional test level
This commit is contained in:
parent
3e1f962a7c
commit
3aa1fe5a3b
11 changed files with 51 additions and 29 deletions
16
Scenes/Levels/test.tscn
Normal file
16
Scenes/Levels/test.tscn
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
[gd_scene format=4 uid="uid://croa7q6fdkfup"]
|
||||
|
||||
[ext_resource type="TileSet" uid="uid://bxbrytgrtnaie" path="res://Sprites/Tile Sets/main.tres" id="1_4te2q"]
|
||||
[ext_resource type="Script" uid="uid://c1x6111kr1dqa" path="res://Scripts/Levels/test.gd" id="1_q1p36"]
|
||||
[ext_resource type="PackedScene" uid="uid://syx6ov00a585" path="res://Scenes/player.tscn" id="2_q1p36"]
|
||||
|
||||
[node name="Main" type="Node2D" unique_id=441925255]
|
||||
script = ExtResource("1_q1p36")
|
||||
|
||||
[node name="TileMapLayer" type="TileMapLayer" parent="." unique_id=1288252359]
|
||||
position = Vector2(1, 0)
|
||||
tile_map_data = PackedByteArray("AAADAAgAAAAAAAEAAAAEAAgAAAAAAAEAAAAFAAgAAAAAAAEAAAAGAAgAAAAAAAEAAAAHAAgAAAAAAAEAAAALAAgAAAAAAAEAAAALAAUAAAAAAAEAAAALAAYAAAAAAAEAAAALAAcAAAAAAAEAAAALAAQAAAAAAAEAAAAKAAQAAAAAAAEAAAAJAAQAAAAAAAEAAAAIAAQAAAAAAAEAAAAHAAQAAAAAAAEAAAAGAAQAAAAAAAEAAAAFAAQAAAAAAAEAAAAEAAQAAAAAAAEAAAADAAQAAAAAAAEAAAACAAQAAAAAAAEAAAACAAUAAAAAAAEAAAACAAYAAAAAAAEAAAACAAcAAAAAAAEAAAACAAgAAAAAAAEAAAAHAAkAAAAAAAEAAAAHAAoAAAAAAAEAAAAHAAsAAAAAAAEAAAAHAAwAAAAAAAEAAAAIAAwAAAAAAAEAAAAJAAwAAAAAAAEAAAAKAAwAAAAAAAEAAAALAAwAAAAAAAEAAAAMAAwAAAAAAAEAAAANAAwAAAAAAAEAAAAOAAwAAAAAAAEAAAAMAAgAAAAAAAEAAAANAAgAAAAAAAEAAAAOAAgAAAAAAAEAAAAPAAwAAAAAAAEAAAAQAAwAAAAAAAEAAAAQAAsAAAAAAAEAAAAQAAoAAAAAAAEAAAAQAAkAAAAAAAEAAAAQAAgAAAAAAAEAAAAPAAgAAAAAAAEAAAAIAAgAAAACAAEAAAAJAAgAAAACAAEAAAAKAAgAAAACAAEAAAA=")
|
||||
tile_set = ExtResource("1_4te2q")
|
||||
|
||||
[node name="Player" parent="." unique_id=791571 instance=ExtResource("2_q1p36")]
|
||||
position = Vector2(56, 119)
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=7 format=3 uid="uid://syx6ov00a585"]
|
||||
[gd_scene format=3 uid="uid://syx6ov00a585"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://ohb2t6o7wr1u" path="res://Scripts/player.gd" id="1_cvnsp"]
|
||||
[ext_resource type="Texture2D" uid="uid://btqnhg54e1p66" path="res://Sprites/png/spritesheet.png" id="2_6t5aa"]
|
||||
|
|
@ -9,31 +9,31 @@
|
|||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_jjgbg"]
|
||||
size = Vector2(16, 16)
|
||||
|
||||
[node name="Player" type="CharacterBody2D"]
|
||||
[node name="Player" type="CharacterBody2D" unique_id=178862163]
|
||||
script = ExtResource("1_cvnsp")
|
||||
|
||||
[node name="GPUParticles2D" type="GPUParticles2D" parent="."]
|
||||
[node name="GPUParticles2D" type="GPUParticles2D" parent="." unique_id=1770667535]
|
||||
emitting = false
|
||||
amount = 100
|
||||
lifetime = 3.3699999999999997
|
||||
process_material = ExtResource("2_vgqql")
|
||||
|
||||
[node name="Sprite" type="Sprite2D" parent="."]
|
||||
[node name="Sprite" type="Sprite2D" parent="." unique_id=2108867379]
|
||||
texture = ExtResource("2_6t5aa")
|
||||
hframes = 3
|
||||
vframes = 3
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=2085434834]
|
||||
shape = SubResource("RectangleShape2D_jjgbg")
|
||||
|
||||
[node name="VisibleOnScreenNotifier2D" type="VisibleOnScreenNotifier2D" parent="."]
|
||||
[node name="VisibleOnScreenNotifier2D" type="VisibleOnScreenNotifier2D" parent="." unique_id=1070217901]
|
||||
rect = Rect2(-8, -8, 16, 16)
|
||||
|
||||
[node name="Camera" type="Camera2D" parent="."]
|
||||
[node name="Camera" type="Camera2D" parent="." unique_id=915178662]
|
||||
top_level = true
|
||||
script = ExtResource("4_vgqql")
|
||||
|
||||
[node name="SceneTransitionRect" parent="." instance=ExtResource("5_fkybt")]
|
||||
[node name="SceneTransitionRect" parent="." unique_id=726492614 instance=ExtResource("5_fkybt")]
|
||||
offset_left = -5000.0
|
||||
offset_top = -5000.0
|
||||
offset_right = 5000.0
|
||||
|
|
|
|||
14
Scripts/Levels/test.gd
Normal file
14
Scripts/Levels/test.gd
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
extends Node2D
|
||||
|
||||
@onready var tile_layer : TileMapLayer = $TileMapLayer
|
||||
|
||||
var startPosX : int = 56
|
||||
var startPosY : int = 120
|
||||
|
||||
var next_level : String = "res://Scenes/main.tscn"
|
||||
|
||||
func event():
|
||||
tile_layer.set_cell(Vector2i(3,7), 0, Vector2i(2,0), 0)
|
||||
tile_layer.erase_cell(Vector2i(8,8))
|
||||
tile_layer.erase_cell(Vector2i(9,8))
|
||||
tile_layer.erase_cell(Vector2i(10,8))
|
||||
1
Scripts/Levels/test.gd.uid
Normal file
1
Scripts/Levels/test.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://c1x6111kr1dqa
|
||||
|
|
@ -38,7 +38,7 @@ func _physics_process(delta: float) -> void:
|
|||
velocity.x += al_globals.x_gravity * delta
|
||||
|
||||
#Gravity flip.
|
||||
if Input.is_action_just_pressed("flip") and (is_on_floor() or is_on_ceiling()):
|
||||
if Input.is_action_just_pressed("flip") and (is_on_floor() or is_on_ceiling() or is_on_wall()):
|
||||
al_globals.y_gravity *= -1
|
||||
|
||||
#If the player is moving downwards fast, turn on particles. Otherwise, disable them.
|
||||
|
|
@ -71,17 +71,22 @@ func tilemap_detection() -> void:
|
|||
if exit_data == true:
|
||||
next_level(current_level.next_level) #Pulls next level data from parent Node2D.
|
||||
|
||||
var event_data = tile_data.get_custom_data("event")
|
||||
if event_data == true:
|
||||
current_level.event()
|
||||
|
||||
var left_grav_data = tile_data.get_custom_data("left_grav")
|
||||
if left_grav_data:
|
||||
al_globals.x_gravity = al_globals.gravity * -5
|
||||
|
||||
var right_grav_data = tile_data.get_custom_data("right_grav")
|
||||
if right_grav_data:
|
||||
al_globals.x_gravity = al_globals.gravity * 5
|
||||
al_globals.x_gravity = al_globals.gravity * 15
|
||||
|
||||
var canc_grav_data = tile_data.get_custom_data("canc_grav")
|
||||
if canc_grav_data:
|
||||
al_globals.x_gravity = 0
|
||||
al_globals.y_gravity = al_globals.gravity
|
||||
|
||||
#Facilitates the death of the player.
|
||||
func death(fallen: bool) -> void:
|
||||
|
|
|
|||
|
|
@ -4,11 +4,9 @@ extends Camera2D
|
|||
|
||||
@export var camera_speed : float = 6.0
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
pass # Replace with function body.
|
||||
pass
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _physics_process(delta: float) -> void:
|
||||
position.x = lerp(position.x, player.position.x, camera_speed * delta)
|
||||
position.y = lerp(position.y, player.position.y, camera_speed * delta)
|
||||
|
|
|
|||
Binary file not shown.
|
Before Width: | Height: | Size: 129 B After Width: | Height: | Size: 2.4 KiB |
|
|
@ -3,15 +3,11 @@
|
|||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://r6u1jtnbr4eg"
|
||||
path="res://.godot/imported/atop.png-e7eeb8db1372f6d12e66a684718d9524.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
valid=false
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://addons/_Godot-IDE_/plugins/script_splitter/assets/atop.png"
|
||||
dest_files=["res://.godot/imported/atop.png-e7eeb8db1372f6d12e66a684718d9524.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
|
|
|
|||
|
|
@ -3,15 +3,11 @@
|
|||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cxds5tr6aq5v3"
|
||||
path="res://.godot/imported/file_in.png-af9f02cc8f82ddae25e5704ad234b217.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
valid=false
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://addons/_Godot-IDE_/plugins/script_splitter/assets/file_in.png"
|
||||
dest_files=["res://.godot/imported/file_in.png-af9f02cc8f82ddae25e5704ad234b217.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
|
|
|
|||
|
|
@ -3,15 +3,11 @@
|
|||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://x8xl24etv1nb"
|
||||
path="res://.godot/imported/warning.png-7a2d105cf05eee357eaf1264447091e5.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
valid=false
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://addons/_Godot-IDE_/shared_resources/warning.png"
|
||||
dest_files=["res://.godot/imported/warning.png-7a2d105cf05eee357eaf1264447091e5.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue