forked from team-sg/hero-mark-2
enemies can be squashed by rocks
This commit is contained in:
parent
20fa885736
commit
4790b2b2a4
9 changed files with 34 additions and 26 deletions
|
@ -1,3 +1,3 @@
|
|||
source_md5="ba0f18fbc880afaa809050eefe6ffa1a"
|
||||
dest_md5="c2f722aa299fb7c7e51f196a477370cc"
|
||||
source_md5="234b7948dfce0e2acd7cadd00f04daa1"
|
||||
dest_md5="21956716b623996381004ca0e06ba1ef"
|
||||
|
||||
|
|
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 223 B After Width: | Height: | Size: 221 B |
|
@ -1,9 +1,8 @@
|
|||
[gd_scene load_steps=14 format=2]
|
||||
[gd_scene load_steps=12 format=2]
|
||||
|
||||
[ext_resource path="res://objects/player/player.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://objects/ladder/ladder.tscn" type="PackedScene" id=2]
|
||||
[ext_resource path="res://graphics/backgrounds/blue_sky.png" type="Texture" id=3]
|
||||
[ext_resource path="res://objects/enemy/snake.tscn" type="PackedScene" id=4]
|
||||
[ext_resource path="res://objects/enemy/slime.tscn" type="PackedScene" id=5]
|
||||
[ext_resource path="res://tilesets/t_grass.tres" type="TileSet" id=7]
|
||||
[ext_resource path="res://objects/Camera2D.tscn" type="PackedScene" id=8]
|
||||
|
@ -11,7 +10,6 @@
|
|||
[ext_resource path="res://tilesets/t_water.tres" type="TileSet" id=10]
|
||||
[ext_resource path="res://objects/rock/rock.tscn" type="PackedScene" id=11]
|
||||
[ext_resource path="res://objects/collectibles/shard.tscn" type="PackedScene" id=12]
|
||||
[ext_resource path="res://objects/barrier/barrier.tscn" type="PackedScene" id=13]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=1]
|
||||
extents = Vector2( 8, 96 )
|
||||
|
@ -33,7 +31,7 @@ __meta__ = {
|
|||
tile_set = ExtResource( 7 )
|
||||
cell_size = Vector2( 8, 8 )
|
||||
format = 1
|
||||
tile_data = PoolIntArray( 6, 0, 0, 7, 0, 0, 65542, 0, 1, 65543, 0, 1, 131078, 0, 1, 131079, 0, 1, 196614, 0, 1, 196615, 0, 1, 393219, 0, 65536, 393220, 0, 65537, 393221, 0, 65537, 393222, 0, 65537, 393223, 0, 65537, 393224, 0, 65537, 393225, 0, 65537, 393226, 0, 65537, 393227, 0, 65538, 393230, 0, 65536, 393231, 0, 65537, 393232, 0, 65537, 393233, 0, 65538, 393236, 0, 65536, 393237, 0, 65537, 393238, 0, 65537, 393239, 0, 65537, 393240, 0, 65537, 393241, 0, 65538, 720904, 0, 65536, 720905, 0, 65537, 720906, 0, 65537, 720907, 0, 65537, 720908, 0, 65537, 720909, 0, 65537, 720910, 0, 65537, 720911, 0, 65538, 786433, 0, 65536, 786434, 0, 65537, 786435, 0, 65537, 786436, 0, 65537, 786437, 0, 65538, 917521, 0, 65536, 917522, 0, 65537, 917523, 0, 65537, 917524, 0, 65537, 917525, 0, 65537, 917526, 0, 65537, 917527, 0, 65537, 917528, 0, 65537, 917529, 0, 65537, 917530, 0, 65537, 917531, 0, 65537, 917532, 0, 65538, 1114118, 0, 65536, 1114119, 0, 65537, 1114120, 0, 65537, 1114121, 0, 65537, 1114122, 0, 65537, 1114123, 0, 65537, 1114124, 0, 65537, 1114125, 0, 65537, 1114126, 0, 65538, 1179649, 0, 65536, 1179650, 0, 65537, 1179651, 0, 65538, 1310736, 0, 131072, 1310737, 536870912, 0, 1310738, 536870912, 0, 1310739, 536870912, 0, 1310740, 0, 131073, 1376271, 0, 131072, 1376272, 0, 131075, 1376273, 536870912, 1, 1376274, 536870912, 1, 1376275, 536870912, 1, 1376276, 0, 131074, 1376277, 0, 131073, 1441792, 0, 0, 1441793, 0, 0, 1441794, 0, 0, 1441795, 0, 0, 1441796, 0, 0, 1441797, 0, 0, 1441798, 0, 0, 1441799, 0, 0, 1441800, 0, 0, 1441801, 0, 0, 1441802, 0, 0, 1441803, 0, 0, 1441804, 0, 0, 1441805, 0, 0, 1441806, 0, 0, 1441807, 0, 131075, 1441808, 0, 1, 1441809, 0, 1, 1441810, 0, 1, 1441811, 0, 1, 1441812, 0, 1, 1441813, 0, 131074, 1441814, 0, 0, 1441815, 0, 0, 1441816, 0, 0, 1441817, 0, 0, 1441818, 0, 0, 1441819, 0, 0, 1441820, 0, 0, 1441821, 0, 0, 1441822, 0, 0, 1441823, 0, 0, 1441824, 0, 0, 1441825, 0, 0, 1441826, 0, 0, 1441827, 0, 0, 1441828, 0, 0, 1441829, 0, 0, 1441830, 0, 0, 1441831, 0, 0, 1441832, 0, 0, 1441833, 0, 0, 1441834, 0, 0, 1441835, 0, 0, 1441836, 0, 0, 1441837, 0, 0, 1441838, 0, 0, 1441839, 0, 0, 1507328, 0, 1, 1507329, 0, 1, 1507330, 0, 1, 1507331, 0, 1, 1507332, 0, 1, 1507333, 0, 1, 1507334, 0, 1, 1507335, 0, 1, 1507336, 0, 1, 1507337, 0, 1, 1507338, 0, 1, 1507339, 0, 1, 1507340, 0, 1, 1507341, 0, 1, 1507342, 0, 1, 1507343, 0, 1, 1507344, 0, 1, 1507345, 0, 1, 1507346, 0, 1, 1507347, 0, 1, 1507348, 0, 1, 1507349, 0, 1, 1507350, 0, 1, 1507351, 0, 1, 1507352, 0, 1, 1507353, 0, 1, 1507354, 0, 1, 1507355, 0, 1, 1507356, 0, 1, 1507357, 0, 1, 1507358, 0, 1, 1507359, 0, 1, 1507360, 0, 1, 1507361, 0, 1, 1507362, 0, 1, 1507363, 0, 1, 1507364, 0, 1, 1507365, 0, 1, 1507366, 0, 1, 1507367, 0, 1, 1507368, 0, 1, 1507369, 0, 1, 1507370, 0, 1, 1507371, 0, 1, 1507372, 0, 1, 1507373, 0, 1, 1507374, 0, 1, 1507375, 0, 1 )
|
||||
tile_data = PoolIntArray( 393219, 0, 65536, 393220, 0, 65537, 393221, 0, 65537, 393222, 0, 65537, 393223, 0, 65537, 393224, 0, 65537, 393225, 0, 65537, 393226, 0, 65537, 393227, 0, 65538, 393230, 0, 65536, 393231, 0, 65537, 393232, 0, 65537, 393233, 0, 65538, 393236, 0, 65536, 393237, 0, 65537, 393238, 0, 65537, 393239, 0, 65537, 393240, 0, 65537, 393241, 0, 65538, 720904, 0, 65536, 720905, 0, 65537, 720906, 0, 65537, 720907, 0, 65537, 720908, 0, 65537, 720909, 0, 65537, 720910, 0, 65537, 720911, 0, 65538, 786433, 0, 65536, 786434, 0, 65537, 786435, 0, 65537, 786436, 0, 65537, 786437, 0, 65538, 917521, 0, 65536, 917522, 0, 65537, 917523, 0, 65537, 917524, 0, 65537, 917525, 0, 65537, 917526, 0, 65537, 917527, 0, 65537, 917528, 0, 65537, 917529, 0, 65537, 917530, 0, 65537, 917531, 0, 65537, 917532, 0, 65538, 1114118, 0, 65536, 1114119, 0, 65537, 1114120, 0, 65537, 1114121, 0, 65537, 1114122, 0, 65537, 1114123, 0, 65537, 1114124, 0, 65537, 1114125, 0, 65537, 1114126, 0, 65538, 1179649, 0, 65536, 1179650, 0, 65537, 1179651, 0, 65538, 1310736, 0, 131072, 1310737, 536870912, 0, 1310738, 536870912, 0, 1310739, 536870912, 0, 1310740, 0, 131073, 1376271, 0, 131072, 1376272, 0, 131075, 1376273, 536870912, 1, 1376274, 536870912, 1, 1376275, 536870912, 1, 1376276, 0, 131074, 1376277, 0, 131073, 1441792, 0, 0, 1441793, 0, 0, 1441794, 0, 0, 1441795, 0, 0, 1441796, 0, 0, 1441797, 0, 0, 1441798, 0, 0, 1441799, 0, 0, 1441800, 0, 0, 1441801, 0, 0, 1441802, 0, 0, 1441803, 0, 0, 1441804, 0, 0, 1441805, 0, 0, 1441806, 0, 0, 1441807, 0, 131075, 1441808, 0, 1, 1441809, 0, 1, 1441810, 0, 1, 1441811, 0, 1, 1441812, 0, 1, 1441813, 0, 131074, 1441814, 0, 0, 1441815, 0, 0, 1441816, 0, 0, 1441817, 0, 0, 1441818, 0, 0, 1441819, 0, 0, 1441820, 0, 0, 1441821, 0, 0, 1441822, 0, 0, 1441823, 0, 0, 1441824, 0, 0, 1441825, 0, 0, 1441826, 0, 0, 1441827, 0, 0, 1441828, 0, 0, 1441829, 0, 0, 1441830, 0, 0, 1441831, 0, 0, 1441832, 0, 0, 1441833, 0, 0, 1441834, 0, 0, 1441835, 0, 0, 1441836, 0, 0, 1441837, 0, 0, 1441838, 0, 0, 1441839, 0, 0, 1507328, 0, 1, 1507329, 0, 1, 1507330, 0, 1, 1507331, 0, 1, 1507332, 0, 1, 1507333, 0, 1, 1507334, 0, 1, 1507335, 0, 1, 1507336, 0, 1, 1507337, 0, 1, 1507338, 0, 1, 1507339, 0, 1, 1507340, 0, 1, 1507341, 0, 1, 1507342, 0, 1, 1507343, 0, 1, 1507344, 0, 1, 1507345, 0, 1, 1507346, 0, 1, 1507347, 0, 1, 1507348, 0, 1, 1507349, 0, 1, 1507350, 0, 1, 1507351, 0, 1, 1507352, 0, 1, 1507353, 0, 1, 1507354, 0, 1, 1507355, 0, 1, 1507356, 0, 1, 1507357, 0, 1, 1507358, 0, 1, 1507359, 0, 1, 1507360, 0, 1, 1507361, 0, 1, 1507362, 0, 1, 1507363, 0, 1, 1507364, 0, 1, 1507365, 0, 1, 1507366, 0, 1, 1507367, 0, 1, 1507368, 0, 1, 1507369, 0, 1, 1507370, 0, 1, 1507371, 0, 1, 1507372, 0, 1, 1507373, 0, 1, 1507374, 0, 1, 1507375, 0, 1 )
|
||||
|
||||
[node name="Water" type="TileMap" parent="."]
|
||||
tile_set = ExtResource( 10 )
|
||||
|
@ -42,7 +40,7 @@ format = 1
|
|||
tile_data = PoolIntArray( 1507376, 0, 0, 1507377, 0, 0, 1507378, 0, 0, 1507379, 0, 0, 1507380, 0, 0, 1507381, 0, 0, 1507382, 0, 0, 1507383, 0, 0, 1507384, 0, 0, 1507385, 0, 0, 1507386, 0, 0, 1507387, 0, 0, 1507388, 0, 0, 1507389, 0, 0, 1507390, 0, 0, 1507391, 0, 0 )
|
||||
|
||||
[node name="Player" parent="." instance=ExtResource( 1 )]
|
||||
position = Vector2( 88, 112 )
|
||||
position = Vector2( 168, 96 )
|
||||
|
||||
[node name="Ladder" type="TileMap" parent="."]
|
||||
tile_set = ExtResource( 7 )
|
||||
|
@ -71,19 +69,16 @@ scale = Vector2( 1, 9 )
|
|||
[node name="Shard" parent="Collectibles" instance=ExtResource( 12 )]
|
||||
position = Vector2( 32, 40 )
|
||||
|
||||
[node name="Slime" parent="Collectibles" instance=ExtResource( 5 )]
|
||||
position = Vector2( 144, 160 )
|
||||
[node name="Enemies" type="Node2D" parent="."]
|
||||
|
||||
[node name="Snake" parent="Collectibles" instance=ExtResource( 4 )]
|
||||
position = Vector2( 56, 168 )
|
||||
right_down_boundry = 3.0
|
||||
[node name="Slime" parent="Enemies" instance=ExtResource( 5 )]
|
||||
position = Vector2( 128, 152 )
|
||||
|
||||
[node name="Rock" parent="." instance=ExtResource( 11 )]
|
||||
position = Vector2( 104, 128 )
|
||||
position = Vector2( 144, 104 )
|
||||
|
||||
[node name="Barrier" parent="." instance=ExtResource( 13 )]
|
||||
position = Vector2( 48, 32 )
|
||||
cost = 3
|
||||
[node name="Rock2" parent="." instance=ExtResource( 11 )]
|
||||
position = Vector2( 144, 152 )
|
||||
|
||||
[node name="ColorRect" type="ColorRect" parent="."]
|
||||
margin_left = 256.0
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
extends Node2D
|
||||
|
||||
export var can_be_killed_by_sword = true
|
||||
export var can_be_squashed = true
|
||||
|
||||
func _on_Area2D_area_entered(area):
|
||||
#Kill player
|
||||
|
@ -10,4 +11,8 @@ func _on_Area2D_area_entered(area):
|
|||
if area.is_in_group("sword"):
|
||||
if can_be_killed_by_sword:
|
||||
queue_free()
|
||||
|
||||
#Die from rock/ get squashed
|
||||
if area.is_in_group("squash"):
|
||||
var squasher = area.get_parent()
|
||||
if squasher.position.y + squasher.bottom.position.y < global_position.y:
|
||||
queue_free()
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
extends "res://objects/enemy/enemy.gd"
|
||||
|
||||
func _process(delta):
|
||||
scale.x = -1
|
|
@ -3,7 +3,7 @@
|
|||
[ext_resource path="res://graphics/enemy/slime.png" type="Texture" id=1]
|
||||
[ext_resource path="res://scripts/recolor_border.shader" type="Shader" id=2]
|
||||
[ext_resource path="res://graphics/enemy/slime_purple.png" type="Texture" id=3]
|
||||
[ext_resource path="res://objects/enemy/enemy_stationary.gd" type="Script" id=4]
|
||||
[ext_resource path="res://objects/enemy/enemy.gd" type="Script" id=4]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id=1]
|
||||
shader = ExtResource( 2 )
|
||||
|
@ -35,15 +35,14 @@ script = ExtResource( 4 )
|
|||
|
||||
[node name="AnimatedSprite" type="AnimatedSprite" parent="."]
|
||||
material = SubResource( 1 )
|
||||
position = Vector2( 5, -5 )
|
||||
position = Vector2( 5, 3 )
|
||||
frames = SubResource( 4 )
|
||||
playing = true
|
||||
|
||||
[node name="Area2D" type="Area2D" parent="."]
|
||||
visible = false
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
|
||||
position = Vector2( 4.5, -4.5 )
|
||||
position = Vector2( 4.5, 3.5 )
|
||||
shape = SubResource( 5 )
|
||||
|
||||
[connection signal="area_entered" from="Area2D" to="." method="_on_Area2D_area_entered"]
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
extends KinematicBody2D
|
||||
var velocity = Vector2.ZERO
|
||||
onready var bottom = $Bottom
|
||||
|
||||
func _physics_process(delta):
|
||||
if !is_on_floor():
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=6 format=2]
|
||||
[gd_scene load_steps=7 format=2]
|
||||
|
||||
[ext_resource path="res://graphics/rock/rock.png" type="Texture" id=1]
|
||||
[ext_resource path="res://scripts/1px_border.gdshader" type="Shader" id=2]
|
||||
|
@ -12,6 +12,9 @@ shader_param/border_corners = false
|
|||
[sub_resource type="RectangleShape2D" id=2]
|
||||
extents = Vector2( 5, 4.5 )
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=3]
|
||||
extents = Vector2( 5, 4.5 )
|
||||
|
||||
[node name="Rock" type="KinematicBody2D" groups=["pushable"]]
|
||||
script = ExtResource( 3 )
|
||||
|
||||
|
@ -24,3 +27,12 @@ centered = false
|
|||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
position = Vector2( 5, 3.5 )
|
||||
shape = SubResource( 2 )
|
||||
|
||||
[node name="Area2D" type="Area2D" parent="." groups=["squash"]]
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
|
||||
position = Vector2( 5, 3.5 )
|
||||
shape = SubResource( 3 )
|
||||
|
||||
[node name="Bottom" type="Position2D" parent="."]
|
||||
position = Vector2( 5, 8 )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue