Added 3 simple enemy types

The first avoids falling off ledges,
the second falls only off of safe ledges
and the thirds darts towards the player when
he is touching the same unobstructed ground
it is on.
This commit is contained in:
Jakob Feldmann 2022-07-12 18:05:34 +02:00
parent f8aed2f056
commit 1351dbb004
19 changed files with 499 additions and 84 deletions

View File

@ -97,7 +97,6 @@ position = Vector2( 0, -16 )
texture = SubResource( 5 ) texture = SubResource( 5 )
hframes = 3 hframes = 3
vframes = 3 vframes = 3
frame = 7
__meta__ = { __meta__ = {
"_editor_description_": "YXNlcHJpdGVfd2l6YXJkX2NvbmZpZwpwbGF5ZXJ8PUJsb2JieVNwcml0ZS9CbG9iYnltYXRpb25QbGF5ZXIKc291cmNlfD1yZXM6Ly9hc3NldHMvYmxvYmJ5L2Jsb2JieS1zcHJpdGVzaGVldHQuYXNlcHJpdGUKbGF5ZXJ8PUJsb2JieQpvcF9leHB8PUZhbHNlCm9fZm9sZGVyfD0Kb19uYW1lfD0Kb25seV92aXNpYmxlfD1GYWxzZQpvX2V4X3B8PQo=" "_editor_description_": "YXNlcHJpdGVfd2l6YXJkX2NvbmZpZwpwbGF5ZXJ8PUJsb2JieVNwcml0ZS9CbG9iYnltYXRpb25QbGF5ZXIKc291cmNlfD1yZXM6Ly9hc3NldHMvYmxvYmJ5L2Jsb2JieS1zcHJpdGVzaGVldHQuYXNlcHJpdGUKbGF5ZXJ8PUJsb2JieQpvcF9leHB8PUZhbHNlCm9fZm9sZGVyfD0Kb19uYW1lfD0Kb25seV92aXNpYmxlfD1GYWxzZQpvX2V4X3B8PQo="
} }

View File

@ -0,0 +1,39 @@
extends Player
export var score := 100
func _ready() -> void:
set_physics_process(false)
# TODO adapt to groups
func _on_StompDetector_body_entered(body: Node) -> void:
if body.global_position.y > get_node("StompDetector").global_position.y:
return
get_node("EnemyBody").disabled = true
die()
func _physics_process(delta: float) -> void:
velocity.y += _gravity * delta
velocity.x = 80 * player_on_floor_direction()
print(velocity.x)
velocity.y = move_and_slide(velocity, FLOOR_NORMAL).y
# TODO Detects player over gaps
func player_on_floor_direction():
for raycast in $LedgeDetectorRays.get_children():
if raycast.is_colliding():
var collider = raycast.get_collider()
if collider.is_in_group("player"):
return sign(collider.position.x - self.position.x)
return 0
func die() -> void:
queue_free()
PlayerData.score += score
func _on_EnemySkin_area_entered(area:Area2D) -> void:
if area.is_in_group("harmful"):
get_node("EnemyBody").disabled = true
die()

View File

@ -0,0 +1,74 @@
[gd_scene load_steps=6 format=2]
[ext_resource path="res://assets/enemy/enemy.png" type="Texture" id=1]
[ext_resource path="res://src/Actors/Enemies/Beings/DartingEnemy.gd" type="Script" id=2]
[sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 2.72463, 1.17848 )
[sub_resource type="RectangleShape2D" id=2]
extents = Vector2( 15, 6.12039 )
[sub_resource type="RectangleShape2D" id=3]
extents = Vector2( 15.534, 10.0962 )
[node name="DartingEnemy" type="KinematicBody2D" groups=["harmful"]]
collision_layer = 2
collision_mask = 9
script = ExtResource( 2 )
[node name="enemy" type="Sprite" parent="."]
position = Vector2( 0, -1.90735e-06 )
scale = Vector2( 0.286789, 0.276348 )
texture = ExtResource( 1 )
[node name="VisibilityEnabler2D" type="VisibilityEnabler2D" parent="."]
position = Vector2( 1362.81, -0.138177 )
scale = Vector2( 15.4865, 1.28502 )
rect = Rect2( -89, -10, 2, 20 )
process_parent = true
physics_process_parent = true
[node name="EnemyBody" type="CollisionShape2D" parent="." groups=["harmful"]]
position = Vector2( 0, 6.48802 )
scale = Vector2( 5.68128, 5.29182 )
shape = SubResource( 1 )
[node name="StompDetector" type="Area2D" parent="." groups=["weakpoint"]]
modulate = Color( 0, 0.0392157, 1, 1 )
position = Vector2( 0, -6.44095 )
collision_layer = 2
input_pickable = false
[node name="CollisionShape2D" type="CollisionShape2D" parent="StompDetector"]
position = Vector2( -4.76837e-07, 0.561345 )
shape = SubResource( 2 )
[node name="LedgeDetectorRays" type="Node2D" parent="."]
position = Vector2( -14, 12 )
[node name="RayCast2D" type="RayCast2D" parent="LedgeDetectorRays"]
position = Vector2( 1, 0 )
rotation = 1.5708
enabled = true
cast_to = Vector2( 0, 1000 )
collision_mask = 121
[node name="RayCast2D2" type="RayCast2D" parent="LedgeDetectorRays"]
position = Vector2( 27, 0 )
rotation = -1.5708
enabled = true
cast_to = Vector2( 0, 1000 )
collision_mask = 121
[node name="EnemySkin" type="Area2D" parent="." groups=["player"]]
process_priority = -1
collision_mask = 126
[node name="CollisionPolygon2D" type="CollisionShape2D" parent="EnemySkin"]
position = Vector2( 5.96046e-07, 2.5 )
scale = Vector2( 1.03, 1.04 )
shape = SubResource( 3 )
[connection signal="body_entered" from="StompDetector" to="." method="_on_StompDetector_body_entered"]
[connection signal="area_entered" from="EnemySkin" to="." method="_on_EnemySkin_area_entered"]

View File

@ -26,3 +26,9 @@ func _physics_process(delta: float) -> void:
func die() -> void: func die() -> void:
queue_free() queue_free()
PlayerData.score += score PlayerData.score += score
func _on_EnemySkin_area_entered(area:Area2D) -> void:
if area.is_in_group("harmful"):
get_node("EnemyBody").disabled = true
die()

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=5 format=2] [gd_scene load_steps=6 format=2]
[ext_resource path="res://assets/enemy/enemy.png" type="Texture" id=1] [ext_resource path="res://assets/enemy/enemy.png" type="Texture" id=1]
[ext_resource path="res://src/Actors/Enemies/Beings/Enemy.gd" type="Script" id=2] [ext_resource path="res://src/Actors/Enemies/Beings/Enemy.gd" type="Script" id=2]
@ -9,6 +9,9 @@ extents = Vector2( 2.72463, 1.17848 )
[sub_resource type="RectangleShape2D" id=2] [sub_resource type="RectangleShape2D" id=2]
extents = Vector2( 15.4794, 6.68174 ) extents = Vector2( 15.4794, 6.68174 )
[sub_resource type="RectangleShape2D" id=3]
extents = Vector2( 15.534, 10.0962 )
[node name="Enemy" type="KinematicBody2D" groups=["harmful"]] [node name="Enemy" type="KinematicBody2D" groups=["harmful"]]
collision_layer = 2 collision_layer = 2
collision_mask = 9 collision_mask = 9
@ -40,4 +43,14 @@ input_pickable = false
[node name="CollisionShape2D" type="CollisionShape2D" parent="StompDetector"] [node name="CollisionShape2D" type="CollisionShape2D" parent="StompDetector"]
shape = SubResource( 2 ) shape = SubResource( 2 )
[node name="EnemySkin" type="Area2D" parent="." groups=["player"]]
process_priority = -1
collision_mask = 126
[node name="CollisionPolygon2D" type="CollisionShape2D" parent="EnemySkin"]
position = Vector2( 5.96046e-07, 2.5 )
scale = Vector2( 1.03, 1.04 )
shape = SubResource( 3 )
[connection signal="body_entered" from="StompDetector" to="." method="_on_StompDetector_body_entered"] [connection signal="body_entered" from="StompDetector" to="." method="_on_StompDetector_body_entered"]
[connection signal="area_entered" from="EnemySkin" to="." method="_on_EnemySkin_area_entered"]

View File

@ -0,0 +1,39 @@
extends Player
export var score := 100
func _ready() -> void:
set_physics_process(false)
velocity.x = -30
# TODO adapt to groups
func _on_StompDetector_body_entered(body: Node) -> void:
if body.global_position.y > get_node("StompDetector").global_position.y:
return
get_node("EnemyBody").disabled = true
die()
func _physics_process(delta: float) -> void:
velocity.y += _gravity * delta
if is_on_wall() or is_at_ledge():
velocity.x *= -1.0
velocity.y = move_and_slide(velocity, FLOOR_NORMAL).y
func is_at_ledge():
for raycast in $LedgeDetectorRays.get_children():
if !raycast.is_colliding():
return true
return false
func die() -> void:
queue_free()
PlayerData.score += score
func _on_EnemySkin_area_entered(area:Area2D) -> void:
if area.is_in_group("harmful"):
get_node("EnemyBody").disabled = true
die()

View File

@ -0,0 +1,71 @@
[gd_scene load_steps=6 format=2]
[ext_resource path="res://assets/enemy/enemy.png" type="Texture" id=1]
[ext_resource path="res://src/Actors/Enemies/Beings/SimpleEnemy.gd" type="Script" id=2]
[sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 2.72463, 1.17848 )
[sub_resource type="RectangleShape2D" id=2]
extents = Vector2( 15.4794, 6.68174 )
[sub_resource type="RectangleShape2D" id=3]
extents = Vector2( 15.534, 10.0962 )
[node name="SimpleEnemy" type="KinematicBody2D" groups=["harmful"]]
collision_layer = 2
collision_mask = 9
script = ExtResource( 2 )
[node name="enemy" type="Sprite" parent="."]
position = Vector2( 0, -1.90735e-06 )
scale = Vector2( 0.286789, 0.276348 )
texture = ExtResource( 1 )
[node name="VisibilityEnabler2D" type="VisibilityEnabler2D" parent="."]
position = Vector2( 1362.81, -0.138177 )
scale = Vector2( 15.4865, 1.28502 )
rect = Rect2( -89, -10, 2, 20 )
process_parent = true
physics_process_parent = true
[node name="EnemyBody" type="CollisionShape2D" parent="." groups=["harmful"]]
position = Vector2( 0, 6.48802 )
scale = Vector2( 5.68128, 5.29182 )
shape = SubResource( 1 )
[node name="StompDetector" type="Area2D" parent="." groups=["weakpoint"]]
modulate = Color( 0, 0.0392157, 1, 1 )
position = Vector2( 0, -6.44095 )
collision_layer = 2
input_pickable = false
[node name="CollisionShape2D" type="CollisionShape2D" parent="StompDetector"]
shape = SubResource( 2 )
[node name="LedgeDetectorRays" type="Node2D" parent="."]
position = Vector2( -14, 12 )
[node name="RayCast2D" type="RayCast2D" parent="LedgeDetectorRays"]
position = Vector2( 1, 0 )
enabled = true
cast_to = Vector2( 0, 2 )
collision_mask = 120
[node name="RayCast2D2" type="RayCast2D" parent="LedgeDetectorRays"]
position = Vector2( 27, 0 )
enabled = true
cast_to = Vector2( 0, 2 )
collision_mask = 120
[node name="EnemySkin" type="Area2D" parent="." groups=["player"]]
process_priority = -1
collision_mask = 126
[node name="CollisionPolygon2D" type="CollisionShape2D" parent="EnemySkin"]
position = Vector2( 5.96046e-07, 2.5 )
scale = Vector2( 1.03, 1.04 )
shape = SubResource( 3 )
[connection signal="body_entered" from="StompDetector" to="." method="_on_StompDetector_body_entered"]
[connection signal="area_entered" from="EnemySkin" to="." method="_on_EnemySkin_area_entered"]

View File

@ -0,0 +1,39 @@
extends Player
export var score := 100
func _ready() -> void:
set_physics_process(false)
velocity.x = -30
# TODO adapt to groups
func _on_StompDetector_body_entered(body: Node) -> void:
if body.global_position.y > get_node("StompDetector").global_position.y:
return
get_node("EnemyBody").disabled = true
die()
func _physics_process(delta: float) -> void:
velocity.y += _gravity * delta
if is_on_wall() or !is_safe_drop():
velocity.x *= -1.0
velocity.y = move_and_slide(velocity, FLOOR_NORMAL).y
func is_safe_drop():
for raycast in $LedgeDetectorRays.get_children():
if raycast.is_colliding():
var collider = raycast.get_collider()
if collider.is_in_group("harmful"):
return false
return true
func die() -> void:
queue_free()
PlayerData.score += score
func _on_EnemySkin_area_entered(area:Area2D) -> void:
if area.is_in_group("harmful"):
get_node("EnemyBody").disabled = true
die()

View File

@ -0,0 +1,76 @@
[gd_scene load_steps=6 format=2]
[ext_resource path="res://assets/enemy/enemy.png" type="Texture" id=1]
[ext_resource path="res://src/Actors/Enemies/Beings/SmortEnemy.gd" type="Script" id=2]
[sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 2.72463, 1.17848 )
[sub_resource type="RectangleShape2D" id=2]
extents = Vector2( 15, 6.12039 )
[sub_resource type="RectangleShape2D" id=3]
extents = Vector2( 15.534, 10.0962 )
[node name="SmortEnemy" type="KinematicBody2D" groups=["harmful"]]
collision_layer = 2
collision_mask = 9
script = ExtResource( 2 )
[node name="enemy" type="Sprite" parent="."]
position = Vector2( 0, -1.90735e-06 )
scale = Vector2( 0.286789, 0.276348 )
texture = ExtResource( 1 )
[node name="VisibilityEnabler2D" type="VisibilityEnabler2D" parent="."]
position = Vector2( 1362.81, -0.138177 )
scale = Vector2( 15.4865, 1.28502 )
rect = Rect2( -89, -10, 2, 20 )
process_parent = true
physics_process_parent = true
[node name="EnemyBody" type="CollisionShape2D" parent="." groups=["harmful"]]
position = Vector2( 0, 6.48802 )
scale = Vector2( 5.68128, 5.29182 )
shape = SubResource( 1 )
[node name="StompDetector" type="Area2D" parent="." groups=["weakpoint"]]
modulate = Color( 0, 0.0392157, 1, 1 )
position = Vector2( 0, -6.44095 )
collision_layer = 2
input_pickable = false
[node name="CollisionShape2D" type="CollisionShape2D" parent="StompDetector"]
position = Vector2( -4.76837e-07, 0.561345 )
shape = SubResource( 2 )
[node name="LedgeDetectorRays" type="Node2D" parent="."]
position = Vector2( -14, 12 )
[node name="RayCast2D" type="RayCast2D" parent="LedgeDetectorRays"]
position = Vector2( 1, 0 )
enabled = true
cast_to = Vector2( 0, 1000 )
collision_mask = 120
collide_with_areas = true
collide_with_bodies = false
[node name="RayCast2D2" type="RayCast2D" parent="LedgeDetectorRays"]
position = Vector2( 27, 0 )
enabled = true
cast_to = Vector2( 0, 1000 )
collision_mask = 120
collide_with_areas = true
collide_with_bodies = false
[node name="EnemySkin" type="Area2D" parent="." groups=["player"]]
process_priority = -1
collision_mask = 126
[node name="CollisionPolygon2D" type="CollisionShape2D" parent="EnemySkin"]
position = Vector2( 5.96046e-07, 2.5 )
scale = Vector2( 1.03, 1.04 )
shape = SubResource( 3 )
[connection signal="body_entered" from="StompDetector" to="." method="_on_StompDetector_body_entered"]
[connection signal="area_entered" from="EnemySkin" to="." method="_on_EnemySkin_area_entered"]

View File

@ -2,7 +2,7 @@
[ext_resource path="res://src/Contraptions/Platform/FlyingLaserCutter.gd" type="Script" id=1] [ext_resource path="res://src/Contraptions/Platform/FlyingLaserCutter.gd" type="Script" id=1]
[sub_resource type="StreamTexture" id=6] [sub_resource type="StreamTexture" id=5]
load_path = "res://.import/FlyingLaserCutter.png-9cf80385a79c58041216f8c2509a5bab.stex" load_path = "res://.import/FlyingLaserCutter.png-9cf80385a79c58041216f8c2509a5bab.stex"
[sub_resource type="Animation" id=2] [sub_resource type="Animation" id=2]
@ -36,31 +36,36 @@ collision_mask = 57
collision/safe_margin = 0.001 collision/safe_margin = 0.001
[node name="Sprite" type="Sprite" parent="FlyingLaserCutterBody"] [node name="Sprite" type="Sprite" parent="FlyingLaserCutterBody"]
texture = SubResource( 6 ) texture = SubResource( 5 )
hframes = 5 hframes = 5
vframes = 5 vframes = 5
frame = 21
__meta__ = { __meta__ = {
"_editor_description_": "YXNlcHJpdGVfd2l6YXJkX2NvbmZpZwpwbGF5ZXJ8PVNwcml0ZS9BbmltYXRpb25QbGF5ZXIKc291cmNlfD1yZXM6Ly9hc3NldHMvY29udHJhcHRpb24vRmx5aW5nTGFzZXJDdXR0ZXIuYXNlcHJpdGUKbGF5ZXJ8PQpvcF9leHB8PUZhbHNlCm9fZm9sZGVyfD0Kb19uYW1lfD0Kb25seV92aXNpYmxlfD1GYWxzZQpvX2V4X3B8PQo=" "_editor_description_": "YXNlcHJpdGVfd2l6YXJkX2NvbmZpZwpwbGF5ZXJ8PUZseWluZ0xhc2VyQ3V0dGVyQm9keS9TcHJpdGUvQW5pbWF0aW9uUGxheWVyCnNvdXJjZXw9cmVzOi8vYXNzZXRzL2NvbnRyYXB0aW9uL0ZseWluZ0xhc2VyQ3V0dGVyLmFzZXByaXRlCmxheWVyfD0Kb3BfZXhwfD1GYWxzZQpvX2ZvbGRlcnw9Cm9fbmFtZXw9Cm9ubHlfdmlzaWJsZXw9RmFsc2UKb19leF9wfD0K"
} }
[node name="AnimationPlayer" type="AnimationPlayer" parent="FlyingLaserCutterBody/Sprite"] [node name="AnimationPlayer" type="AnimationPlayer" parent="FlyingLaserCutterBody/Sprite"]
anims/default = SubResource( 2 ) anims/default = SubResource( 2 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="FlyingLaserCutterBody"] [node name="CollisionShape2D" type="CollisionShape2D" parent="FlyingLaserCutterBody"]
visible = false
position = Vector2( -0.461, 0 ) position = Vector2( -0.461, 0 )
shape = SubResource( 3 ) shape = SubResource( 3 )
[node name="LaserArea" type="Area2D" parent="FlyingLaserCutterBody" groups=["harmful"]] [node name="LaserArea" type="Area2D" parent="FlyingLaserCutterBody" groups=["harmful"]]
process_priority = -1 process_priority = -1
visible = false
collision_layer = 32 collision_layer = 32
collision_mask = 3 collision_mask = 3
[node name="PainZone" type="CollisionShape2D" parent="FlyingLaserCutterBody/LaserArea" groups=["harmful"]] [node name="PainZone" type="CollisionShape2D" parent="FlyingLaserCutterBody/LaserArea" groups=["harmful"]]
process_priority = -1 process_priority = -1
visible = false
position = Vector2( 9.64728, 0.0077219 ) position = Vector2( 9.64728, 0.0077219 )
shape = SubResource( 4 ) shape = SubResource( 4 )
[node name="Triggers" type="Node2D" parent="FlyingLaserCutterBody"] [node name="Triggers" type="Node2D" parent="FlyingLaserCutterBody"]
visible = false
position = Vector2( 0, 0.0077219 ) position = Vector2( 0, 0.0077219 )
[node name="RayCast2D" type="RayCast2D" parent="FlyingLaserCutterBody/Triggers"] [node name="RayCast2D" type="RayCast2D" parent="FlyingLaserCutterBody/Triggers"]

View File

@ -1,7 +1,7 @@
[gd_scene load_steps=2 format=2] [gd_scene load_steps=2 format=2]
[sub_resource type="RectangleShape2D" id=1] [sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 12, 12 ) extents = Vector2( 11, 11 )
[node name="DangerousBlockArea" type="Node2D" groups=["harmful"]] [node name="DangerousBlockArea" type="Node2D" groups=["harmful"]]

View File

@ -0,0 +1,89 @@
[gd_scene load_steps=11 format=2]
[ext_resource path="res://src/Actors/Blobby/Blobby.tscn" type="PackedScene" id=1]
[ext_resource path="res://assets/environment/blocks/24BlockBasic.png" type="Texture" id=2]
[ext_resource path="res://src/UserInterface/Buttons/UI.tscn" type="PackedScene" id=3]
[ext_resource path="res://src/HarmfulObjects/Spikes.tscn" type="PackedScene" id=4]
[ext_resource path="res://src/Actors/Enemies/Beings/Enemy.tscn" type="PackedScene" id=5]
[ext_resource path="res://src/Actors/Enemies/Beings/SimpleEnemy.tscn" type="PackedScene" id=6]
[ext_resource path="res://src/Actors/Enemies/Beings/SmortEnemy.tscn" type="PackedScene" id=7]
[ext_resource path="res://src/Actors/Enemies/Beings/DartingEnemy.tscn" type="PackedScene" id=8]
[sub_resource type="ConvexPolygonShape2D" id=3]
points = PoolVector2Array( 0, 0, 24, 0, 24, 24, 0, 24 )
[sub_resource type="TileSet" id=2]
1/name = "24BlockBasic.png 1"
1/texture = ExtResource( 2 )
1/tex_offset = Vector2( 0, 0 )
1/modulate = Color( 1, 1, 1, 1 )
1/region = Rect2( 0, 0, 24, 24 )
1/tile_mode = 0
1/occluder_offset = Vector2( 0, 0 )
1/navigation_offset = Vector2( 0, 0 )
1/shape_offset = Vector2( 0, 0 )
1/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
1/shape = SubResource( 3 )
1/shape_one_way = false
1/shape_one_way_margin = 1.0
1/shapes = [ {
"autotile_coord": Vector2( 0, 0 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 3 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
} ]
1/z_index = 0
[node name="LevelTemplate" type="Node2D"]
__meta__ = {
"_edit_horizontal_guides_": [ 464.0 ],
"_edit_vertical_guides_": [ 2880.0 ]
}
[node name="UserInterface" parent="." instance=ExtResource( 3 )]
[node name="Blobby" parent="." instance=ExtResource( 1 )]
position = Vector2( -259.915, 710.547 )
[node name="SmortEnemy" parent="." instance=ExtResource( 7 )]
position = Vector2( 220, 804 )
[node name="Enemy" parent="." instance=ExtResource( 5 )]
position = Vector2( 0, 780 )
[node name="Enemy2" parent="." instance=ExtResource( 6 )]
position = Vector2( 492, 804 )
[node name="DartingEnemy" parent="." instance=ExtResource( 8 )]
position = Vector2( 800, 875 )
[node name="Spikes" parent="." instance=ExtResource( 4 )]
position = Vector2( -180, 900 )
[node name="Spikes3" parent="." instance=ExtResource( 4 )]
position = Vector2( 108, 900 )
[node name="Spikes5" parent="." instance=ExtResource( 4 )]
position = Vector2( 372, 900 )
[node name="Spikes4" parent="." instance=ExtResource( 4 )]
position = Vector2( 132, 900 )
[node name="Spikes6" parent="." instance=ExtResource( 4 )]
position = Vector2( 348, 900 )
[node name="Spikes2" parent="." instance=ExtResource( 4 )]
position = Vector2( -156, 900 )
[node name="TileMap" type="TileMap" parent="."]
tile_set = SubResource( 2 )
cell_size = Vector2( 24, 24 )
cell_quadrant_size = 24
cell_custom_transform = Transform2D( 24, 0, 0, 24, 0, 0 )
collision_use_kinematic = true
collision_friction = 0.0
collision_layer = 8
collision_mask = 0
format = 1
tile_data = PoolIntArray( 1179634, 1, 0, 1245170, 1, 0, 1310706, 1, 0, 1376242, 1, 0, 1441778, 1, 0, 1507314, 1, 0, 1572850, 1, 0, 1638386, 1, 0, 1703922, 1, 0, 1769458, 1, 0, 1834994, 1, 0, 1900530, 1, 0, 1966066, 1, 0, 1966069, 536870912, 0, 1966071, 1, 0, 1900544, 0, 0, 2031602, 1, 0, 2031603, 1, 0, 2031604, 1, 0, 2031605, 1, 0, 2031606, 1, 0, 2031607, 1, 0, 1966080, 0, 0, 2097138, 1, 0, 2097139, 1, 0, 2097140, 1, 0, 2097141, 1, 0, 2097142, 1, 0, 2097143, 1, 0, 2162674, 1, 0, 2162679, 1, 0, 2228210, 1, 0, 2228215, 1, 0, 2228220, 1, 0, 2228221, 1, 0, 2228222, 1, 0, 2228223, 1, 0, 2162688, 1, 0, 2162726, 1, 0, 2293746, 1, 0, 2293751, 1, 0, 2228230, 1, 0, 2228231, 1, 0, 2228232, 1, 0, 2228233, 1, 0, 2228234, 1, 0, 2228235, 1, 0, 2228242, 1, 0, 2228243, 1, 0, 2228244, 1, 0, 2228245, 1, 0, 2228246, 1, 0, 2228262, 1, 0, 2359282, 1, 0, 2359287, 1, 0, 2293798, 1, 0, 2424818, 1, 0, 2424823, 1, 0, 2424827, 1, 0, 2359323, 1, 0, 2359334, 1, 0, 2490354, 1, 0, 2490355, 1, 0, 2490356, 1, 0, 2490357, 1, 0, 2490358, 1, 0, 2490359, 1, 0, 2490362, 1, 0, 2490363, 1, 0, 2490364, 1, 0, 2490365, 1, 0, 2490366, 1, 0, 2490367, 1, 0, 2424832, 1, 0, 2424833, 1, 0, 2424834, 1, 0, 2424835, 1, 0, 2424838, 1, 0, 2424839, 1, 0, 2424840, 1, 0, 2424841, 1, 0, 2424842, 1, 0, 2424843, 1, 0, 2424844, 1, 0, 2424845, 1, 0, 2424848, 1, 0, 2424849, 1, 0, 2424850, 1, 0, 2424851, 1, 0, 2424852, 1, 0, 2424853, 1, 0, 2424854, 1, 0, 2424855, 1, 0, 2424856, 1, 0, 2424857, 1, 0, 2424858, 1, 0, 2424859, 1, 0, 2424860, 1, 0, 2424861, 1, 0, 2424862, 1, 0, 2424863, 1, 0, 2424864, 1, 0, 2424865, 1, 0, 2424866, 1, 0, 2424867, 1, 0, 2424868, 1, 0, 2424869, 1, 0, 2424870, 1, 0, 2555895, 1, 0, 2555896, 1, 0, 2555897, 1, 0, 2555898, 1, 0, 2555899, 1, 0, 2555900, 1, 0, 2555901, 1, 0, 2555902, 1, 0, 2555903, 1, 0, 2490368, 1, 0, 2490369, 1, 0, 2490370, 1, 0, 2490371, 1, 0, 2490372, 1, 0, 2490373, 1, 0, 2490374, 1, 0, 2490375, 1, 0, 2490376, 1, 0, 2490377, 1, 0, 2490378, 1, 0, 2490379, 1, 0, 2490380, 1, 0, 2490381, 1, 0, 2490382, 1, 0, 2490383, 1, 0 )

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -1,35 +0,0 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/Layer 1.png-52e5c3fdf7fae7b4b7f3caca0133b862.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://src/Levels/Layer 1.png"
dest_files=[ "res://.import/Layer 1.png-52e5c3fdf7fae7b4b7f3caca0133b862.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=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=false
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

File diff suppressed because one or more lines are too long

View File

@ -1,15 +0,0 @@
extends Node2D
onready var level_viewport_container = $ViewportContainer
onready var level_viewport = $ViewportContainer/Viewport
onready var screen_res = get_viewport().size
var scaling = Vector2()
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
scaling = screen_res / level_viewport.size
print(screen_res)
print(level_viewport.size)
print(scaling)
level_viewport_container.rect_scale *= scaling

View File

@ -1,9 +1,24 @@
[gd_scene load_steps=2 format=2] [gd_scene load_steps=2 format=2]
[ext_resource path="res://src/Levels/Viewport Test Level.gd" type="Script" id=1] [sub_resource type="GDScript" id=1]
script/source = "extends Node2D
onready var level_viewport_container = $ViewportContainer
onready var level_viewport = $ViewportContainer/Viewport
onready var screen_res = get_viewport().size
var scaling = Vector2()
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
scaling = screen_res / level_viewport.size
print(screen_res)
print(level_viewport.size)
print(scaling)
level_viewport_container.rect_scale *= scaling"
[node name="ViewportTestLevel" type="Node2D"] [node name="ViewportTestLevel" type="Node2D"]
script = ExtResource( 1 ) script = SubResource( 1 )
[node name="ViewportContainer" type="ViewportContainer" parent="."] [node name="ViewportContainer" type="ViewportContainer" parent="."]
margin_right = 1920.0 margin_right = 1920.0

View File

@ -52,7 +52,7 @@ size_flags_horizontal = 3
[node name="PlayButton" parent="MenuContainer/Buttons" instance=ExtResource( 3 )] [node name="PlayButton" parent="MenuContainer/Buttons" instance=ExtResource( 3 )]
margin_right = 296.0 margin_right = 296.0
margin_bottom = 48.0 margin_bottom = 48.0
next_scene_path = "res://src/Levels/24TileSizeLevel.tscn" next_scene_path = "res://src/Levels/Enemy Test Level.tscn"
[node name="QuitButton" parent="MenuContainer/Buttons" instance=ExtResource( 1 )] [node name="QuitButton" parent="MenuContainer/Buttons" instance=ExtResource( 1 )]
anchor_left = 0.0 anchor_left = 0.0