forked from team-sg/hero-mark-2
start work on boss1
This commit is contained in:
parent
ed04bf1c2e
commit
85f3a0af08
8 changed files with 244 additions and 7 deletions
BIN
audio/music/klystron.mp3
Normal file
BIN
audio/music/klystron.mp3
Normal file
Binary file not shown.
15
audio/music/klystron.mp3.import
Normal file
15
audio/music/klystron.mp3.import
Normal file
|
@ -0,0 +1,15 @@
|
|||
[remap]
|
||||
|
||||
importer="mp3"
|
||||
type="AudioStreamMP3"
|
||||
path="res://.import/klystron.mp3-602926993b6a74c407f1b84641b06fdd.mp3str"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://audio/music/klystron.mp3"
|
||||
dest_files=[ "res://.import/klystron.mp3-602926993b6a74c407f1b84641b06fdd.mp3str" ]
|
||||
|
||||
[params]
|
||||
|
||||
loop=true
|
||||
loop_offset=0
|
3
game.gd
3
game.gd
|
@ -47,6 +47,7 @@ var current_file = 1 #Current save file
|
|||
var shards_collected = [false,false,false,false,false,false,false,false,false,false]
|
||||
var is_marathon_mode = false
|
||||
var use_lives = false
|
||||
var can_pause = true
|
||||
|
||||
func _ready():
|
||||
Save.load_file(current_file)
|
||||
|
@ -161,6 +162,6 @@ func _process(delta):
|
|||
else:
|
||||
OS.set_window_fullscreen(false)
|
||||
#Pause
|
||||
if Input.is_action_just_pressed("pause"):
|
||||
if Input.is_action_just_pressed("pause") && can_pause:
|
||||
var viewport = get_parent().get_node("Main/Control/ViewportContainer/Viewport")
|
||||
viewport.add_child(pause_screen.instance())
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=13 format=2]
|
||||
[gd_scene load_steps=15 format=2]
|
||||
|
||||
[ext_resource path="res://level_data.gd" type="Script" id=1]
|
||||
[ext_resource path="res://maps/map01.tscn" type="PackedScene" id=2]
|
||||
|
@ -7,6 +7,7 @@
|
|||
[ext_resource path="res://scripts/level_entry.gd" type="Script" id=5]
|
||||
[ext_resource path="res://maps/mountain.tscn" type="PackedScene" id=6]
|
||||
[ext_resource path="res://maps/abyss.tscn" type="PackedScene" id=7]
|
||||
[ext_resource path="res://maps/boss/boss1_arena.tscn" type="PackedScene" id=8]
|
||||
|
||||
[sub_resource type="Resource" id=1]
|
||||
resource_name = "Verdant Hills"
|
||||
|
@ -32,6 +33,14 @@ shard_titles = [ "Fiend's Trick Jump", "Speed Snake!", "Twin Rolling Fiends", "C
|
|||
save_id = "mountain"
|
||||
scene = ExtResource( 6 )
|
||||
|
||||
[sub_resource type="Resource" id=6]
|
||||
resource_name = "VS Boss1"
|
||||
script = ExtResource( 5 )
|
||||
title = "VS Boss1"
|
||||
shard_titles = [ "-w-", "owo", "uwu", "o3o", "5 Rainbow Stars", "Collection Bonus", "Time Bonus", "Life Bonus" ]
|
||||
save_id = "Boss1"
|
||||
scene = ExtResource( 8 )
|
||||
|
||||
[sub_resource type="Resource" id=3]
|
||||
resource_name = "Blue Ray Cavern"
|
||||
script = ExtResource( 5 )
|
||||
|
@ -50,4 +59,4 @@ scene = ExtResource( 7 )
|
|||
|
||||
[node name="LevelData" type="Node"]
|
||||
script = ExtResource( 1 )
|
||||
levels = [ SubResource( 1 ), SubResource( 2 ), SubResource( 4 ), SubResource( 3 ), SubResource( 5 ) ]
|
||||
levels = [ SubResource( 1 ), SubResource( 2 ), SubResource( 4 ), SubResource( 6 ), SubResource( 3 ), SubResource( 5 ) ]
|
||||
|
|
75
maps/boss/boss1_arena.tscn
Normal file
75
maps/boss/boss1_arena.tscn
Normal file
|
@ -0,0 +1,75 @@
|
|||
[gd_scene load_steps=11 format=2]
|
||||
|
||||
[ext_resource path="res://objects/enemy/boss/boss1.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://objects/player/player.tscn" type="PackedScene" id=2]
|
||||
[ext_resource path="res://graphics/backgrounds/mountain_clouds.png" type="Texture" id=3]
|
||||
[ext_resource path="res://graphics/backgrounds/mountain_sunset.png" type="Texture" id=4]
|
||||
[ext_resource path="res://tilesets/t_mountain.tres" type="TileSet" id=5]
|
||||
[ext_resource path="res://objects/hud/hud.tscn" type="PackedScene" id=6]
|
||||
[ext_resource path="res://maps/map.gd" type="Script" id=7]
|
||||
[ext_resource path="res://objects/environment/turniwood/turning_platform.tscn" type="PackedScene" id=9]
|
||||
[ext_resource path="res://objects/environment/ladder/ladder.tscn" type="PackedScene" id=10]
|
||||
[ext_resource path="res://audio/music/klystron.mp3" type="AudioStream" id=11]
|
||||
|
||||
[node name="Map" type="Node2D" groups=["map"]]
|
||||
pause_mode = 1
|
||||
script = ExtResource( 7 )
|
||||
music = ExtResource( 11 )
|
||||
|
||||
[node name="HUD" parent="." instance=ExtResource( 6 )]
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="."]
|
||||
position = Vector2( 128, 96 )
|
||||
z_index = -2
|
||||
texture = ExtResource( 4 )
|
||||
__meta__ = {
|
||||
"_edit_lock_": true
|
||||
}
|
||||
|
||||
[node name="Sprite2" type="Sprite" parent="."]
|
||||
position = Vector2( 128, 96 )
|
||||
z_index = -2
|
||||
texture = ExtResource( 3 )
|
||||
__meta__ = {
|
||||
"_edit_lock_": true
|
||||
}
|
||||
|
||||
[node name="TileMap" type="TileMap" parent="."]
|
||||
tile_set = ExtResource( 5 )
|
||||
cell_size = Vector2( 8, 8 )
|
||||
format = 1
|
||||
tile_data = PoolIntArray( 851972, 0, 65536, 851973, 0, 65538, 851974, 0, 65538, 1114122, 0, 65536, 1114123, 0, 65537, 1114124, 0, 65537, 1114125, 0, 65538, 1310723, 0, 65536, 1310724, 0, 65537, 1310725, 0, 65537, 1310726, 0, 65537, 1310727, 0, 65537, 1310728, 0, 65537, 1310729, 0, 65537, 1310730, 0, 65537, 1310731, 0, 65537, 1310732, 0, 65537, 1310733, 0, 65537, 1310734, 0, 65537, 1310735, 0, 65537, 1310736, 0, 65537, 1310737, 0, 65537, 1310738, 0, 65537, 1310739, 0, 65537, 1310740, 0, 65538 )
|
||||
|
||||
[node name="Ladder" type="TileMap" parent="."]
|
||||
tile_set = ExtResource( 5 )
|
||||
cell_size = Vector2( 8, 8 )
|
||||
format = 1
|
||||
tile_data = PoolIntArray( 851973, 0, 65537, 851976, 1, 0, 917512, 1, 0, 983048, 1, 0, 1310723, 0, 65536, 1310724, 0, 65537, 1310725, 0, 65537, 1310726, 0, 65537, 1310727, 0, 65537, 1310728, 0, 65537, 1310729, 0, 65537, 1310730, 0, 65537, 1310731, 0, 65537, 1310732, 0, 65537, 1310733, 0, 65537, 1310734, 0, 65537, 1310735, 0, 65537, 1310736, 0, 65537, 1310737, 0, 65537, 1310738, 0, 65537, 1310739, 0, 65537, 1310740, 0, 65538 )
|
||||
|
||||
[node name="Player" parent="." instance=ExtResource( 2 )]
|
||||
position = Vector2( 48, 144 )
|
||||
|
||||
[node name="Boss1" parent="." instance=ExtResource( 1 )]
|
||||
position = Vector2( 168, 112 )
|
||||
left_up_boundry = 10.0
|
||||
right_down_boundry = 2.0
|
||||
arrow_spawns = [ Vector2( 92, 128 ), Vector2( 40, 96 ), Vector2( 96, 80 ) ]
|
||||
|
||||
[node name="TurningPlatform" parent="." instance=ExtResource( 9 )]
|
||||
position = Vector2( 72, 144 )
|
||||
|
||||
[node name="TurningPlatform3" parent="." instance=ExtResource( 9 )]
|
||||
position = Vector2( 88, 88 )
|
||||
|
||||
[node name="TurningPlatform4" parent="." instance=ExtResource( 9 )]
|
||||
position = Vector2( 96, 88 )
|
||||
|
||||
[node name="TurningPlatform5" parent="." instance=ExtResource( 9 )]
|
||||
position = Vector2( 104, 88 )
|
||||
|
||||
[node name="TurningPlatform2" parent="." instance=ExtResource( 9 )]
|
||||
position = Vector2( 112, 144 )
|
||||
|
||||
[node name="Ladder2" parent="." instance=ExtResource( 10 )]
|
||||
position = Vector2( 64, 104 )
|
||||
scale = Vector2( 1, 3 )
|
40
objects/enemy/boss/boss1.gd
Normal file
40
objects/enemy/boss/boss1.gd
Normal file
|
@ -0,0 +1,40 @@
|
|||
extends "res://objects/enemy/enemy_move_sidesideupdown.gd"
|
||||
|
||||
var hp = 3
|
||||
var arrow_speed = 80
|
||||
export var phase2_speed = 100
|
||||
export var phase3_speed = 150
|
||||
const ArrowProjectile = preload("res://objects/player/arrow_projectile.tscn")
|
||||
const arrow_pickup = preload("res://objects/collectibles/arrow.tscn")
|
||||
onready var shoot_timer = $ShootTimer
|
||||
var shoot_time = Vector2(0.4,0.7)
|
||||
export var arrow_spawns = [Vector2(0,0),Vector2(0,0),Vector2(0,0)]
|
||||
|
||||
func _ready():
|
||||
seed(hash("HEROMARK2"))
|
||||
|
||||
func _physics_process(delta):
|
||||
match hp:
|
||||
2:
|
||||
speed = phase2_speed
|
||||
shoot_time = Vector2(0.4,0.5)
|
||||
1:
|
||||
speed = phase3_speed
|
||||
shoot_time = Vector2(0.3,0.5)
|
||||
0: die()
|
||||
|
||||
func shoot():
|
||||
var arrow = ArrowProjectile.instance()
|
||||
arrow.global_position = Vector2(
|
||||
global_position.x + $Position2D.position.x,
|
||||
stepify(global_position.y + $Position2D.position.y,8)
|
||||
)
|
||||
arrow.direction = -1
|
||||
arrow.breaks_on_wall = false
|
||||
arrow.target_group = "player"
|
||||
arrow.speed = arrow_speed
|
||||
get_owner().add_child(arrow)
|
||||
|
||||
func _on_ShootTimer_timeout():
|
||||
shoot_timer.start(rand_range(shoot_time.x,shoot_time.y))
|
||||
shoot()
|
90
objects/enemy/boss/boss1.tscn
Normal file
90
objects/enemy/boss/boss1.tscn
Normal file
|
@ -0,0 +1,90 @@
|
|||
[gd_scene load_steps=6 format=2]
|
||||
|
||||
[ext_resource path="res://objects/enemy/boss/boss1.gd" type="Script" id=2]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=1]
|
||||
extents = Vector2( 12, 8 )
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=2]
|
||||
extents = Vector2( 16, 12 )
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=3]
|
||||
extents = Vector2( 16, 4 )
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=4]
|
||||
extents = Vector2( 8, 8 )
|
||||
|
||||
[node name="Boss1" type="Node2D"]
|
||||
script = ExtResource( 2 )
|
||||
move_direction = 1
|
||||
flip_sprite = false
|
||||
|
||||
[node name="Sprite" type="ColorRect" parent="."]
|
||||
margin_left = 8.0
|
||||
margin_right = 40.0
|
||||
margin_bottom = 40.0
|
||||
color = Color( 0.960784, 0.2, 0.258824, 1 )
|
||||
|
||||
[node name="BackPack" type="ColorRect" parent="Sprite"]
|
||||
margin_left = 24.0
|
||||
margin_top = 8.0
|
||||
margin_right = 40.0
|
||||
margin_bottom = 32.0
|
||||
color = Color( 0.960784, 0.2, 0.258824, 1 )
|
||||
|
||||
[node name="LegR" type="ColorRect" parent="Sprite"]
|
||||
margin_top = 40.0
|
||||
margin_right = 8.0
|
||||
margin_bottom = 48.0
|
||||
color = Color( 0.960784, 0.2, 0.258824, 1 )
|
||||
|
||||
[node name="LegL" type="ColorRect" parent="Sprite"]
|
||||
margin_left = 24.0
|
||||
margin_top = 40.0
|
||||
margin_right = 32.0
|
||||
margin_bottom = 48.0
|
||||
color = Color( 0.960784, 0.2, 0.258824, 1 )
|
||||
|
||||
[node name="Visor" type="ColorRect" parent="Sprite"]
|
||||
margin_left = -8.0
|
||||
margin_top = 8.0
|
||||
margin_right = 16.0
|
||||
margin_bottom = 24.0
|
||||
color = Color( 0.27451, 0.796078, 0.756863, 1 )
|
||||
|
||||
[node name="WeakSpot" type="Area2D" parent="." groups=["boss_weakspot", "enemy_hitbox"]]
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="WeakSpot"]
|
||||
position = Vector2( 12, 16 )
|
||||
shape = SubResource( 1 )
|
||||
|
||||
[node name="Hitbox" type="Area2D" parent="." groups=["blocks_arrow", "enemy_hitbox"]]
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox"]
|
||||
position = Vector2( 24, 36 )
|
||||
shape = SubResource( 2 )
|
||||
|
||||
[node name="CollisionShape2D2" type="CollisionShape2D" parent="Hitbox"]
|
||||
position = Vector2( 24, 4 )
|
||||
shape = SubResource( 3 )
|
||||
|
||||
[node name="CollisionShape2D3" type="CollisionShape2D" parent="Hitbox"]
|
||||
position = Vector2( 32, 16 )
|
||||
shape = SubResource( 4 )
|
||||
|
||||
[node name="ShootTimer" type="Timer" parent="."]
|
||||
wait_time = 0.5
|
||||
one_shot = true
|
||||
autostart = true
|
||||
|
||||
[node name="Position2D" type="Position2D" parent="."]
|
||||
position = Vector2( 8, 32 )
|
||||
|
||||
[node name="ArrowSpawnTimer" type="Timer" parent="."]
|
||||
wait_time = 5.0
|
||||
one_shot = true
|
||||
autostart = true
|
||||
|
||||
[connection signal="area_entered" from="Hitbox" to="." method="_on_Hitbox_area_entered"]
|
||||
[connection signal="timeout" from="ShootTimer" to="." method="_on_ShootTimer_timeout"]
|
||||
[connection signal="timeout" from="ArrowSpawnTimer" to="." method="_on_ArrowSpawnTimer_timeout"]
|
|
@ -7,6 +7,9 @@ var target_group = "enemy_hitbox"
|
|||
# direction to fly
|
||||
var direction = 1.0
|
||||
|
||||
# whether or not it frees on wall collision
|
||||
var breaks_on_wall = true
|
||||
|
||||
#Edge to check culling, if this edge is offscreen, delete the arrow
|
||||
onready var cull_edge = Vector2(5 * direction,0)
|
||||
onready var player = get_parent().get_node("Player")
|
||||
|
@ -25,6 +28,7 @@ func _physics_process(delta):
|
|||
|
||||
#Wall Collision
|
||||
func _on_Hitbox_body_entered(body):
|
||||
if breaks_on_wall:
|
||||
if body is TileMap or body is StaticBody2D:
|
||||
_make_sparks()
|
||||
queue_free()
|
||||
|
@ -41,7 +45,10 @@ func _on_Hitbox_area_entered(area):
|
|||
_make_sparks()
|
||||
else:
|
||||
# kill targeted node
|
||||
if !area.is_in_group("boss_weakspot"):
|
||||
target.die()
|
||||
else:
|
||||
target.hp -=1
|
||||
#decrease arrows if enemy killed
|
||||
if target_group == "enemy_hitbox":
|
||||
Game.arrows = max(0, Game.arrows - 1) # clamp arrows above 0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue