Level visuals
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.9 KiB |
BIN
graphics/enemy/pigs/spoink.png
Normal file
After Width: | Height: | Size: 741 B |
35
graphics/enemy/pigs/spoink.png.import
Normal file
|
@ -0,0 +1,35 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/spoink.png-c419333add2909564e9253b1fdac633e.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://graphics/enemy/pigs/spoink.png"
|
||||
dest_files=[ "res://.import/spoink.png-c419333add2909564e9253b1fdac633e.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=true
|
||||
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=true
|
||||
svg/scale=1.0
|
Before Width: | Height: | Size: 563 B After Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 6.1 KiB |
33
objects/enemy/pigs/spoink.gd
Normal file
|
@ -0,0 +1,33 @@
|
|||
extends "res://objects/enemy/enemy.gd"
|
||||
|
||||
|
||||
export var jump_height: float
|
||||
export var jump_distance: float
|
||||
export var gravity: float
|
||||
export var direction: float = 1.0
|
||||
|
||||
|
||||
var velocity: Vector2 = Vector2.ZERO
|
||||
var landed: bool = false
|
||||
|
||||
|
||||
onready var body: Node2D = $Body
|
||||
onready var sprite: Sprite = $Body/Sprite
|
||||
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
death_blood_offset = body.position + Vector2(0.0, -4.0)
|
||||
if not landed:
|
||||
velocity.y += gravity * delta
|
||||
body.position += velocity * delta
|
||||
if body.position.y >= 0.0:
|
||||
landed = true
|
||||
velocity = Vector2.ZERO
|
||||
body.position.y = 0.0
|
||||
sprite.frame = 1
|
||||
direction *= -1.0
|
||||
var tween = create_tween().set_process_mode(Tween.TWEEN_PROCESS_PHYSICS)
|
||||
tween.tween_property(sprite, "frame", 0, 0.0).set_delay(0.5)
|
||||
tween.tween_property(self, "velocity", Vector2(jump_distance * direction, -jump_height), 0.0)
|
||||
tween.tween_property(self, "landed", false, 0.0)
|
||||
tween.tween_callback(tween, "kill")
|
119
objects/enemy/pigs/spoink.tscn
Normal file
|
@ -0,0 +1,119 @@
|
|||
[gd_scene load_steps=6 format=2]
|
||||
|
||||
[ext_resource path="res://graphics/enemy/pigs/spoink.png" type="Texture" id=1]
|
||||
[ext_resource path="res://objects/enemy/pigs/spoink.gd" type="Script" id=2]
|
||||
|
||||
[sub_resource type="Animation" id=1]
|
||||
resource_name = "idle"
|
||||
length = 0.7
|
||||
step = 0.35
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath("Body/Sprite:region_rect")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0 ),
|
||||
"transitions": PoolRealArray( 1 ),
|
||||
"update": 0,
|
||||
"values": [ Rect2( 0, 0, 13, 12 ) ]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/path = NodePath("Body/Sprite:position")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/keys = {
|
||||
"times": PoolRealArray( 0 ),
|
||||
"transitions": PoolRealArray( 1 ),
|
||||
"update": 0,
|
||||
"values": [ Vector2( 4, 2 ) ]
|
||||
}
|
||||
tracks/2/type = "value"
|
||||
tracks/2/path = NodePath("Hitbox:position")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/keys = {
|
||||
"times": PoolRealArray( 0 ),
|
||||
"transitions": PoolRealArray( 1 ),
|
||||
"update": 0,
|
||||
"values": [ Vector2( 0, 0 ) ]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id=2]
|
||||
resource_name = "jump"
|
||||
length = 0.4
|
||||
step = 0.05
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath("Body/Sprite:region_rect")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0 ),
|
||||
"transitions": PoolRealArray( 1 ),
|
||||
"update": 0,
|
||||
"values": [ Rect2( 13, 0, 13, 12 ) ]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/path = NodePath("Body/Sprite:position")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/keys = {
|
||||
"times": PoolRealArray( 0, 0.2, 0.4 ),
|
||||
"transitions": PoolRealArray( 1, 1, 1 ),
|
||||
"update": 0,
|
||||
"values": [ Vector2( 4, 2 ), Vector2( 4, -2 ), Vector2( 4, 2 ) ]
|
||||
}
|
||||
tracks/2/type = "value"
|
||||
tracks/2/path = NodePath("Hitbox:position")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = false
|
||||
tracks/2/keys = {
|
||||
"times": PoolRealArray( 0, 0.2, 0.4 ),
|
||||
"transitions": PoolRealArray( 1, 1, 1 ),
|
||||
"update": 0,
|
||||
"values": [ Vector2( 0, -4 ), Vector2( 0, -8 ), Vector2( 0, -4 ) ]
|
||||
}
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=3]
|
||||
extents = Vector2( 4, 5 )
|
||||
|
||||
[node name="Spoink" type="Node2D" groups=["enemy"]]
|
||||
script = ExtResource( 2 )
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||
playback_process_mode = 0
|
||||
anims/idle = SubResource( 1 )
|
||||
anims/jump = SubResource( 2 )
|
||||
|
||||
[node name="Hitbox" type="Area2D" parent="." groups=["enemy_hitbox"]]
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox"]
|
||||
position = Vector2( 0, -5 )
|
||||
shape = SubResource( 3 )
|
||||
|
||||
[node name="Body" type="Node2D" parent="."]
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="Body"]
|
||||
texture = ExtResource( 1 )
|
||||
offset = Vector2( 0, -8 )
|
||||
hframes = 2
|
||||
region_rect = Rect2( 0, 0, 13, 12 )
|
||||
|
||||
[node name="RemoteTransform2D" type="RemoteTransform2D" parent="Body"]
|
||||
remote_path = NodePath("../../Hitbox")
|
||||
update_rotation = false
|
||||
update_scale = false
|
||||
|
||||
[connection signal="animation_finished" from="AnimationPlayer" to="." method="_on_AnimationPlayer_animation_finished"]
|
||||
[connection signal="area_entered" from="Hitbox" to="." method="_on_Hitbox_area_entered"]
|
|
@ -1,4 +1,4 @@
|
|||
[gd_resource type="TileSet" load_steps=18 format=2]
|
||||
[gd_resource type="TileSet" load_steps=34 format=2]
|
||||
|
||||
[ext_resource path="res://graphics/tiles/mountain.png" type="Texture" id=1]
|
||||
[ext_resource path="res://graphics/tiles/future/mountain_future.png" type="Texture" id=2]
|
||||
|
@ -48,6 +48,54 @@ points = PoolVector2Array( 8, 8, 0, 8, 0, 0, 8, 0 )
|
|||
[sub_resource type="ConvexPolygonShape2D" id=17]
|
||||
points = PoolVector2Array( 8, 2, 0, 2, 0, 2, 8, 2 )
|
||||
|
||||
[sub_resource type="ConvexPolygonShape2D" id=18]
|
||||
points = PoolVector2Array( 8, 8, 0, 8, 0, 0, 8, 0 )
|
||||
|
||||
[sub_resource type="ConvexPolygonShape2D" id=19]
|
||||
points = PoolVector2Array( 8, 8, 0, 8, 0, 0, 8, 0 )
|
||||
|
||||
[sub_resource type="ConvexPolygonShape2D" id=20]
|
||||
points = PoolVector2Array( 8, 8, 0, 8, 0, 0, 8, 0 )
|
||||
|
||||
[sub_resource type="ConvexPolygonShape2D" id=21]
|
||||
points = PoolVector2Array( 8, 8, 0, 8, 0, 0, 8, 0 )
|
||||
|
||||
[sub_resource type="ConvexPolygonShape2D" id=22]
|
||||
points = PoolVector2Array( 8, 8, 0, 8, 0, 0, 8, 0 )
|
||||
|
||||
[sub_resource type="ConvexPolygonShape2D" id=23]
|
||||
points = PoolVector2Array( 8, 8, 0, 8, 0, 0, 8, 0 )
|
||||
|
||||
[sub_resource type="ConvexPolygonShape2D" id=24]
|
||||
points = PoolVector2Array( 8, 8, 0, 8, 0, 0, 8, 0 )
|
||||
|
||||
[sub_resource type="ConvexPolygonShape2D" id=25]
|
||||
points = PoolVector2Array( 8, 8, 0, 8, 0, 0, 8, 0 )
|
||||
|
||||
[sub_resource type="ConvexPolygonShape2D" id=26]
|
||||
points = PoolVector2Array( 8, 8, 0, 8, 0, 0, 8, 0 )
|
||||
|
||||
[sub_resource type="ConvexPolygonShape2D" id=27]
|
||||
points = PoolVector2Array( 8, 8, 0, 8, 0, 0, 8, 0 )
|
||||
|
||||
[sub_resource type="ConvexPolygonShape2D" id=28]
|
||||
points = PoolVector2Array( 8, 8, 0, 8, 0, 0, 8, 0 )
|
||||
|
||||
[sub_resource type="ConvexPolygonShape2D" id=29]
|
||||
points = PoolVector2Array( 8, 8, 0, 8, 0, 0, 8, 0 )
|
||||
|
||||
[sub_resource type="ConvexPolygonShape2D" id=30]
|
||||
points = PoolVector2Array( 8, 8, 0, 8, 0, 0, 8, 0 )
|
||||
|
||||
[sub_resource type="ConvexPolygonShape2D" id=31]
|
||||
points = PoolVector2Array( 8, 8, 0, 8, 0, 0, 8, 0 )
|
||||
|
||||
[sub_resource type="ConvexPolygonShape2D" id=32]
|
||||
points = PoolVector2Array( 8, 8, 0, 8, 0, 0, 8, 0 )
|
||||
|
||||
[sub_resource type="ConvexPolygonShape2D" id=33]
|
||||
points = PoolVector2Array( 8, 8, 0, 8, 0, 0, 8, 0 )
|
||||
|
||||
[resource]
|
||||
0/name = "grass.png 0"
|
||||
0/texture = ExtResource( 2 )
|
||||
|
@ -217,3 +265,124 @@ points = PoolVector2Array( 8, 2, 0, 2, 0, 2, 8, 2 )
|
|||
3/shape_one_way_margin = 0.0
|
||||
3/shapes = [ ]
|
||||
3/z_index = 0
|
||||
4/name = "bacon"
|
||||
4/texture = ExtResource( 2 )
|
||||
4/tex_offset = Vector2( 0, 0 )
|
||||
4/modulate = Color( 1, 1, 1, 1 )
|
||||
4/region = Rect2( 32, 0, 32, 32 )
|
||||
4/tile_mode = 1
|
||||
4/autotile/bitmask_mode = 1
|
||||
4/autotile/bitmask_flags = [ Vector2( 0, 0 ), 16, Vector2( 0, 1 ), 144, Vector2( 0, 2 ), 146, Vector2( 0, 3 ), 18, Vector2( 1, 0 ), 48, Vector2( 1, 1 ), 16777392, Vector2( 1, 2 ), 17039538, Vector2( 1, 3 ), 262194, Vector2( 2, 0 ), 56, Vector2( 2, 1 ), 20971704, Vector2( 2, 2 ), 21299386, Vector2( 2, 3 ), 327738, Vector2( 3, 0 ), 24, Vector2( 3, 1 ), 4194456, Vector2( 3, 2 ), 4259994, Vector2( 3, 3 ), 65562 ]
|
||||
4/autotile/icon_coordinate = Vector2( 0, 0 )
|
||||
4/autotile/tile_size = Vector2( 8, 8 )
|
||||
4/autotile/spacing = 0
|
||||
4/autotile/occluder_map = [ ]
|
||||
4/autotile/navpoly_map = [ ]
|
||||
4/autotile/priority_map = [ ]
|
||||
4/autotile/z_index_map = [ ]
|
||||
4/autotile/fallback_mode = 0
|
||||
4/occluder_offset = Vector2( 0, 0 )
|
||||
4/navigation_offset = Vector2( 0, 0 )
|
||||
4/shape_offset = Vector2( 0, 0 )
|
||||
4/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
4/shape = SubResource( 18 )
|
||||
4/shape_one_way = false
|
||||
4/shape_one_way_margin = 1.0
|
||||
4/shapes = [ {
|
||||
"autotile_coord": Vector2( 0, 0 ),
|
||||
"one_way": false,
|
||||
"one_way_margin": 1.0,
|
||||
"shape": SubResource( 18 ),
|
||||
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
}, {
|
||||
"autotile_coord": Vector2( 1, 0 ),
|
||||
"one_way": false,
|
||||
"one_way_margin": 1.0,
|
||||
"shape": SubResource( 19 ),
|
||||
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
}, {
|
||||
"autotile_coord": Vector2( 2, 0 ),
|
||||
"one_way": false,
|
||||
"one_way_margin": 1.0,
|
||||
"shape": SubResource( 20 ),
|
||||
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
}, {
|
||||
"autotile_coord": Vector2( 3, 0 ),
|
||||
"one_way": false,
|
||||
"one_way_margin": 1.0,
|
||||
"shape": SubResource( 21 ),
|
||||
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
}, {
|
||||
"autotile_coord": Vector2( 0, 1 ),
|
||||
"one_way": false,
|
||||
"one_way_margin": 1.0,
|
||||
"shape": SubResource( 22 ),
|
||||
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
}, {
|
||||
"autotile_coord": Vector2( 1, 1 ),
|
||||
"one_way": false,
|
||||
"one_way_margin": 1.0,
|
||||
"shape": SubResource( 23 ),
|
||||
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
}, {
|
||||
"autotile_coord": Vector2( 2, 1 ),
|
||||
"one_way": false,
|
||||
"one_way_margin": 1.0,
|
||||
"shape": SubResource( 24 ),
|
||||
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
}, {
|
||||
"autotile_coord": Vector2( 3, 1 ),
|
||||
"one_way": false,
|
||||
"one_way_margin": 1.0,
|
||||
"shape": SubResource( 25 ),
|
||||
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
}, {
|
||||
"autotile_coord": Vector2( 0, 2 ),
|
||||
"one_way": false,
|
||||
"one_way_margin": 1.0,
|
||||
"shape": SubResource( 26 ),
|
||||
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
}, {
|
||||
"autotile_coord": Vector2( 1, 2 ),
|
||||
"one_way": false,
|
||||
"one_way_margin": 1.0,
|
||||
"shape": SubResource( 27 ),
|
||||
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
}, {
|
||||
"autotile_coord": Vector2( 2, 2 ),
|
||||
"one_way": false,
|
||||
"one_way_margin": 1.0,
|
||||
"shape": SubResource( 28 ),
|
||||
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
}, {
|
||||
"autotile_coord": Vector2( 3, 2 ),
|
||||
"one_way": false,
|
||||
"one_way_margin": 1.0,
|
||||
"shape": SubResource( 29 ),
|
||||
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
}, {
|
||||
"autotile_coord": Vector2( 0, 3 ),
|
||||
"one_way": false,
|
||||
"one_way_margin": 1.0,
|
||||
"shape": SubResource( 30 ),
|
||||
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
}, {
|
||||
"autotile_coord": Vector2( 1, 3 ),
|
||||
"one_way": false,
|
||||
"one_way_margin": 1.0,
|
||||
"shape": SubResource( 31 ),
|
||||
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
}, {
|
||||
"autotile_coord": Vector2( 2, 3 ),
|
||||
"one_way": false,
|
||||
"one_way_margin": 1.0,
|
||||
"shape": SubResource( 32 ),
|
||||
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
}, {
|
||||
"autotile_coord": Vector2( 3, 3 ),
|
||||
"one_way": false,
|
||||
"one_way_margin": 1.0,
|
||||
"shape": SubResource( 33 ),
|
||||
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
} ]
|
||||
4/z_index = 0
|
||||
|
|
|
@ -213,14 +213,8 @@ points = PoolVector2Array( 8, 8, 0, 8, 0, 0, 8, 0 )
|
|||
10/shape_offset = Vector2( 0, 0 )
|
||||
10/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
10/shape_one_way = false
|
||||
10/shape_one_way_margin = 1.0
|
||||
10/shapes = [ {
|
||||
"autotile_coord": Vector2( 0, 0 ),
|
||||
"one_way": false,
|
||||
"one_way_margin": 1.0,
|
||||
"shape": null,
|
||||
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
} ]
|
||||
10/shape_one_way_margin = 0.0
|
||||
10/shapes = [ ]
|
||||
10/z_index = 10
|
||||
11/name = "water_light_bottom.png 11"
|
||||
11/texture = ExtResource( 9 )
|
||||
|
|