Skip to content

Commit

Permalink
Bubs Now Explode (#496)
Browse files Browse the repository at this point in the history
* fixed bub collision issues?

* explode + fixed flash issue?
  • Loading branch information
Woahsea authored May 15, 2022
1 parent c2e881c commit 006ad57
Show file tree
Hide file tree
Showing 6 changed files with 164 additions and 14 deletions.
Binary file added audio/sfx/effects/explode_small.wav
Binary file not shown.
21 changes: 21 additions & 0 deletions audio/sfx/effects/explode_small.wav.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[remap]

importer="wav"
type="AudioStreamSample"
path="res://.import/explode_small.wav-0a31f9a976b2daf6212015629d617d55.sample"

[deps]

source_file="res://audio/sfx/effects/explode_small.wav"
dest_files=[ "res://.import/explode_small.wav-0a31f9a976b2daf6212015629d617d55.sample" ]

[params]

force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop=false
compress/mode=0
113 changes: 101 additions & 12 deletions scenes/enemies/Bub.tscn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[gd_scene load_steps=25 format=2]
[gd_scene load_steps=39 format=2]

[ext_resource path="res://scenes/enemies/Enemy.tscn" type="PackedScene" id=1]
[ext_resource path="res://sprites/pistol.png" type="Texture" id=2]
Expand All @@ -7,6 +7,8 @@
[ext_resource path="res://scenes/enemies/Bullet.tscn" type="PackedScene" id=5]
[ext_resource path="res://scenes/SimpleExplosion.tscn" type="PackedScene" id=6]
[ext_resource path="res://audio/sfx/pop-gun.wav" type="AudioStream" id=7]
[ext_resource path="res://sprites/projectiles/ombsti_bomb.png" type="Texture" id=8]
[ext_resource path="res://audio/sfx/effects/explode_small.wav" type="AudioStream" id=9]

[sub_resource type="RectangleShape2D" id=12]
extents = Vector2( 26, 24 )
Expand All @@ -19,6 +21,10 @@ region = Rect2( 64, 0, 64, 64 )
atlas = ExtResource( 4 )
region = Rect2( 128, 0, 64, 64 )

[sub_resource type="AtlasTexture" id=32]
atlas = ExtResource( 4 )
region = Rect2( 0, 0, 64, 64 )

[sub_resource type="AtlasTexture" id=24]
atlas = ExtResource( 4 )
region = Rect2( 0, 64, 64, 64 )
Expand All @@ -43,26 +49,22 @@ region = Rect2( 256, 64, 64, 64 )
atlas = ExtResource( 4 )
region = Rect2( 320, 64, 64, 64 )

[sub_resource type="AtlasTexture" id=32]
atlas = ExtResource( 4 )
region = Rect2( 0, 0, 64, 64 )

[sub_resource type="SpriteFrames" id=3]
animations = [ {
"frames": [ SubResource( 30 ), SubResource( 31 ) ],
"loop": true,
"name": "idle",
"speed": 1.0
}, {
"frames": [ SubResource( 24 ), SubResource( 25 ), SubResource( 26 ), SubResource( 27 ), SubResource( 28 ), SubResource( 29 ) ],
"loop": true,
"name": "move",
"speed": 10.0
}, {
"frames": [ SubResource( 32 ) ],
"loop": true,
"name": "die",
"speed": 5.0
}, {
"frames": [ SubResource( 24 ), SubResource( 25 ), SubResource( 26 ), SubResource( 27 ), SubResource( 28 ), SubResource( 29 ) ],
"loop": true,
"name": "move",
"speed": 10.0
} ]

[sub_resource type="Animation" id=34]
Expand Down Expand Up @@ -133,6 +135,7 @@ tracks/4/keys = {

[sub_resource type="Animation" id=23]
resource_name = "die"
step = 0.05
tracks/0/type = "value"
tracks/0/path = NodePath("Sprite:modulate")
tracks/0/interp = 2
Expand Down Expand Up @@ -229,6 +232,30 @@ tracks/7/keys = {
"update": 0,
"values": [ Vector2( 4, 4 ), Vector2( 0, 0 ) ]
}
tracks/8/type = "value"
tracks/8/path = NodePath("Boom:frame")
tracks/8/interp = 1
tracks/8/loop_wrap = true
tracks/8/imported = false
tracks/8/enabled = true
tracks/8/keys = {
"times": PoolRealArray( 0, 0.05, 0.1, 0.15, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7 ),
"transitions": PoolRealArray( 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ),
"update": 1,
"values": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ]
}
tracks/9/type = "value"
tracks/9/path = NodePath("Boom:visible")
tracks/9/interp = 1
tracks/9/loop_wrap = true
tracks/9/imported = false
tracks/9/enabled = true
tracks/9/keys = {
"times": PoolRealArray( 0, 0.8 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 1,
"values": [ true, false ]
}

[sub_resource type="Animation" id=33]
resource_name = "move"
Expand Down Expand Up @@ -293,9 +320,60 @@ _data = [ Vector2( 0, 0.634091 ), 0.0, 0.0, 0, 0, Vector2( 0.769608, 0.7875 ), -
audio_stream = ExtResource( 7 )
random_pitch = 1.5

[sub_resource type="AtlasTexture" id=38]
atlas = ExtResource( 8 )
region = Rect2( 64, 0, 64, 48 )

[sub_resource type="AtlasTexture" id=39]
atlas = ExtResource( 8 )
region = Rect2( 128, 0, 64, 48 )

[sub_resource type="AtlasTexture" id=40]
atlas = ExtResource( 8 )
region = Rect2( 192, 0, 64, 48 )

[sub_resource type="AtlasTexture" id=41]
atlas = ExtResource( 8 )
region = Rect2( 256, 0, 64, 48 )

[sub_resource type="AtlasTexture" id=42]
atlas = ExtResource( 8 )
region = Rect2( 320, 0, 64, 48 )

[sub_resource type="AtlasTexture" id=43]
atlas = ExtResource( 8 )
region = Rect2( 384, 0, 64, 48 )

[sub_resource type="AtlasTexture" id=44]
atlas = ExtResource( 8 )
region = Rect2( 448, 0, 64, 48 )

[sub_resource type="AtlasTexture" id=45]
atlas = ExtResource( 8 )
region = Rect2( 512, 0, 64, 48 )

[sub_resource type="AtlasTexture" id=46]
atlas = ExtResource( 8 )
region = Rect2( 576, 0, 64, 48 )

[sub_resource type="AtlasTexture" id=47]
atlas = ExtResource( 8 )
region = Rect2( 640, 0, 64, 48 )

[sub_resource type="AtlasTexture" id=48]
atlas = ExtResource( 8 )
region = Rect2( 704, 0, 64, 48 )

[sub_resource type="SpriteFrames" id=49]
animations = [ {
"frames": [ SubResource( 38 ), SubResource( 39 ), SubResource( 40 ), SubResource( 41 ), SubResource( 42 ), SubResource( 43 ), SubResource( 44 ), SubResource( 45 ), SubResource( 46 ), SubResource( 47 ), SubResource( 48 ) ],
"loop": true,
"name": "default",
"speed": 10.0
} ]

[node name="Bub" instance=ExtResource( 1 )]
collision_layer = 0
collision_mask = 322
collision_mask = 330
script = ExtResource( 3 )
bullet_scene = ExtResource( 5 )
muzzle_flash_scene = ExtResource( 6 )
Expand Down Expand Up @@ -368,3 +446,14 @@ color = Color( 0.0705882, 0.592157, 0.760784, 1 )
stream = SubResource( 37 )
volume_db = -10.0
bus = "sfx"

[node name="Boom" type="AnimatedSprite" parent="." index="10"]
visible = false
position = Vector2( 0, -32 )
scale = Vector2( 2, 2 )
frames = SubResource( 49 )

[node name="Explode" type="AudioStreamPlayer2D" parent="." index="11"]
stream = ExtResource( 9 )
volume_db = 2.0
bus = "sfx"
9 changes: 7 additions & 2 deletions scripts/Bub.gd
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ var _motion = Vector2.ZERO
var _moving = true
var _shooting_cooldown = 0

var damage = 0

onready var _animation_player := $AnimationPlayer
onready var _ray_walking := $RayCastWalking
onready var _ray_shooting := $RayCastShooting
Expand All @@ -41,6 +43,7 @@ onready var _muzzle := $GunAnchor/Sprite/Muzzle
onready var sprite := $Sprite
onready var tween := $Tween
onready var pop_gun_sfx := $PopGun
onready var explode_sfx := $Explode

onready var original_scale = sprite.scale
onready var squash_scale = Vector2(original_scale.x * 1.4, original_scale.y * 0.4)
Expand Down Expand Up @@ -113,6 +116,7 @@ func _handle_dying(_killer):
EventBus.emit_signal("enemy_hit_fireball")
_animation_player.play("die")
$SquishParticles.emitting = true
explode_sfx.play()
yield(_animation_player, "animation_finished")


Expand All @@ -128,8 +132,9 @@ func fire_bullet():

# instance muzzle flash
var flash = muzzle_flash_scene.instance()
get_tree().root.add_child(flash)
flash.global_position = _muzzle.global_position
get_parent().add_child(flash)
flash.scale = scale
flash.position = _muzzle.global_position

pop_gun_sfx.play()

Expand Down
Binary file added sprites/projectiles/ombsti_bomb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions sprites/projectiles/ombsti_bomb.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[remap]

importer="texture"
type="StreamTexture"
path="res://.import/ombsti_bomb.png-03b2f045065f2440cfe9e88436f45783.stex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://sprites/projectiles/ombsti_bomb.png"
dest_files=[ "res://.import/ombsti_bomb.png-03b2f045065f2440cfe9e88436f45783.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=false
svg/scale=1.0

0 comments on commit 006ad57

Please sign in to comment.