Continuing balancing and fixing. Further improvements to bad class

This commit is contained in:
Sage Vaillancourt 2018-06-05 16:31:55 -04:00
parent 5ea68a6a68
commit 2ae7067aeb
15 changed files with 52 additions and 22 deletions

4
Bad.gd
View File

@ -25,6 +25,7 @@ var screensize
var health_multi = 1 var health_multi = 1
var kill_reward = 0 var kill_reward = 0
var boss = false
var health = 1 var health = 1
var starting_health = 1 var starting_health = 1
var hit_timer = 1000 var hit_timer = 1000
@ -55,5 +56,4 @@ func _process(delta):
if velocity.length() > 0: if velocity.length() > 0:
velocity = velocity.normalized() * speed velocity = velocity.normalized() * speed
position += velocity * delta position += velocity * delta
prints(health)

View File

@ -25,6 +25,7 @@ export (PackedScene) var Laser
var screensize var screensize
var health_multi = 1 var health_multi = 1
var boss = false
var health = 50 var health = 50
var hit_timer = 1000 var hit_timer = 1000

View File

@ -28,7 +28,7 @@ var health = 400
var hit_timer = 1000 var hit_timer = 1000
var can_shoot = true var can_shoot = true
var health_multi = 1 var health_multi = 1
var boss = false
func _on_Visibility_screen_exited(): func _on_Visibility_screen_exited():
prints("bye-bye, bad bad") prints("bye-bye, bad bad")
queue_free() queue_free()

View File

@ -6,12 +6,14 @@ extends "res://Bad.gd"
var rot_speed = 1 var rot_speed = 1
signal flash
func _ready(): func _ready():
starting_health = 5000 starting_health = 20000
health = starting_health health = starting_health
speed = 10 speed = 10
position.x = 700 kill_reward = 1000
position.y = 300 boss = true
var splitting = false var splitting = false
@ -47,5 +49,12 @@ func _process(delta):
$BotHalf.position.y += delta*500 $BotHalf.position.y += delta*500
$BotHalf.position.x += delta*250 $BotHalf.position.x += delta*250
if $TopHalf.position.y < -2000:
$Music.volume_db -= delta*50
if $TopHalf.position.y < -4000:
emit_signal("dead", kill_reward)
queue_free()
$TopHalf.rotation += delta $TopHalf.rotation += delta
$BotHalf.rotation -= delta $BotHalf.rotation -= delta

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=16 format=2] [gd_scene load_steps=17 format=2]
[ext_resource path="res://Bad.tscn" type="PackedScene" id=1] [ext_resource path="res://Bad.tscn" type="PackedScene" id=1]
[ext_resource path="res://BlackHole.gd" type="Script" id=2] [ext_resource path="res://BlackHole.gd" type="Script" id=2]
@ -11,13 +11,14 @@
[ext_resource path="res://art/bad/BlackHole/base_6.png" type="Texture" id=9] [ext_resource path="res://art/bad/BlackHole/base_6.png" type="Texture" id=9]
[ext_resource path="res://art/bad/BlackHole/half2.png" type="Texture" id=10] [ext_resource path="res://art/bad/BlackHole/half2.png" type="Texture" id=10]
[ext_resource path="res://art/bad/BlackHole/half1.png" type="Texture" id=11] [ext_resource path="res://art/bad/BlackHole/half1.png" type="Texture" id=11]
[ext_resource path="res://late_stage_boss.ogg" type="AudioStream" id=12]
[sub_resource type="CircleShape2D" id=2] [sub_resource type="CircleShape2D" id=1]
custom_solver_bias = 0.0 custom_solver_bias = 0.0
radius = 904.987 radius = 904.987
[sub_resource type="SpriteFrames" id=1] [sub_resource type="SpriteFrames" id=2]
animations = [ { animations = [ {
"frames": [ ExtResource( 3 ), ExtResource( 4 ), ExtResource( 5 ), ExtResource( 6 ), ExtResource( 7 ), ExtResource( 8 ), ExtResource( 9 ) ], "frames": [ ExtResource( 3 ), ExtResource( 4 ), ExtResource( 5 ), ExtResource( 6 ), ExtResource( 7 ), ExtResource( 8 ), ExtResource( 9 ) ],
@ -44,19 +45,20 @@ animations = [ {
"speed": 5.0 "speed": 5.0
} ] } ]
[node name="BlackHole" index="0" instance=ExtResource( 1 )] [node name="BlackHole" instance=ExtResource( 1 )]
position = Vector2( 1302.7, 306.846 )
scale = Vector2( 0.3, 0.3 ) scale = Vector2( 0.3, 0.3 )
script = ExtResource( 2 ) script = ExtResource( 2 )
_sections_unfolded = [ "Collision", "Transform" ] _sections_unfolded = [ "Collision", "Transform" ]
[node name="CollisionBox" parent="." index="0"] [node name="CollisionBox" parent="." index="0"]
shape = SubResource( 2 ) shape = SubResource( 1 )
[node name="MainSprite" parent="." index="2"] [node name="MainSprite" parent="." index="2"]
frames = SubResource( 1 ) frames = SubResource( 2 )
[node name="TopHalf" type="AnimatedSprite" parent="." index="3"] [node name="TopHalf" type="AnimatedSprite" parent="." index="3"]
@ -70,4 +72,12 @@ visible = false
frames = SubResource( 4 ) frames = SubResource( 4 )
animation = "default" animation = "default"
[node name="Music" type="AudioStreamPlayer" parent="." index="5"]
stream = ExtResource( 12 )
volume_db = 0.0
autoplay = true
mix_target = 0
bus = "Master"

View File

@ -24,9 +24,7 @@ export (int) var SPEED
var screensize var screensize
var health_multi = 1 var health_multi = 1
# class member variables go here, for example: var boss = false
# var a = 2
# var b = "textvar"
var health = 150 var health = 150
var hit_timer = 1000 var hit_timer = 1000

Binary file not shown.

View File

@ -29,6 +29,7 @@ var plasma = false
var current_pen = 0 var current_pen = 0
var friendly_laser = true var friendly_laser = true
var damage = DEFAULT_DAMAGE var damage = DEFAULT_DAMAGE
var boss = false
func _ready(): func _ready():
$AnimatedSprite.play() $AnimatedSprite.play()

View File

@ -19,7 +19,7 @@ animations = [ {
"speed": 20.0 "speed": 20.0
} ] } ]
[node name="Laser" type="Area2D"] [node name="Laser" type="Area2D" index="0"]
input_pickable = true input_pickable = true
gravity_vec = Vector2( 0, 1 ) gravity_vec = Vector2( 0, 1 )

11
Main.gd
View File

@ -48,6 +48,8 @@ func _ready():
# Prepare black rectangle for fading in # Prepare black rectangle for fading in
$ColorRect.visible = true $ColorRect.visible = true
randomize()
if OS.has_touchscreen_ui_hint(): if OS.has_touchscreen_ui_hint():
$HowTo.visible = true $HowTo.visible = true
else: else:
@ -139,7 +141,7 @@ var sendblob = 1
var bad_health_multi = 1.5 var bad_health_multi = 1.5
var total_bads_spawned = 0 var total_bads_spawned = 0
func BaddieTimer(): func BaddieTimer():
if total_bads_spawned == 5: # 75 default if total_bads_spawned%6 == 0: # 75 default
if get_tree().is_network_server(): if get_tree().is_network_server():
total_bads_spawned += 1 total_bads_spawned += 1
rpc("bossMode") rpc("bossMode")
@ -282,8 +284,11 @@ sync func bossMode():
func _launch_boss(): func _launch_boss():
prints("_launch_boss()") prints("_launch_boss()")
var bad var bad
#bad = RectangleBoss.instance() var which_boss = randi()%2
bad = BlackHole.instance() if which_boss == 0:
bad = RectangleBoss.instance()
elif which_boss == 1:
bad = BlackHole.instance()
add_child(bad) add_child(bad)
# Flash screen when signalled # Flash screen when signalled

View File

@ -53,7 +53,11 @@ func _on_Mothership_area_shape_entered(area_id, area, area_shape, self_shape):
if get_tree().is_network_server(): if get_tree().is_network_server():
health -= 50 health -= 50
rset("slave_health", health) rset("slave_health", health)
if area.boss:
emit_signal("flash")
health = 0
_update_health_bar() _update_health_bar()
if health <= 250: if health <= 250:

View File

@ -78,7 +78,7 @@ const LASER_DAMAGE_TIER5_COST = 2000
const STARTING_POSITION = Vector2(130, 250) const STARTING_POSITION = Vector2(130, 250)
# the amount of money the player starts with # the amount of money the player starts with
const STARTING_MONEY = 100 const STARTING_MONEY = 10000
################################# #################################

View File

@ -51,7 +51,7 @@ animations = [ {
custom_solver_bias = 0.0 custom_solver_bias = 0.0
extents = Vector2( 404.313, 217.774 ) extents = Vector2( 404.313, 217.774 )
[node name="RectangleBoss" type="Area2D" index="0"] [node name="RectangleBoss" type="Area2D"]
position = Vector2( 336.401, -1.22772 ) position = Vector2( 336.401, -1.22772 )
scale = Vector2( 0.25, 0.25 ) scale = Vector2( 0.25, 0.25 )

2
TODO
View File

@ -1,3 +1,4 @@
* Get the game on F-Droid
* More enemy variety * More enemy variety
* A way of increasing difficulty without it suddenly becoming impossible * A way of increasing difficulty without it suddenly becoming impossible
* Mothership art * Mothership art
@ -5,4 +6,5 @@
* The main menu stars could do something silly and fun, like change colors, * The main menu stars could do something silly and fun, like change colors,
maybe taking the menu colors with them. maybe taking the menu colors with them.
* Purchasable Mothership upgrades (like turrets), and make all upgrades exponentially more expensive for higher tiers * Purchasable Mothership upgrades (like turrets), and make all upgrades exponentially more expensive for higher tiers
* Sounds effects for upgrades
* etc., etc. * etc., etc.

BIN
late_stage_boss.ogg Normal file

Binary file not shown.