fixed tabbing, small type issues
This commit is contained in:
parent
7b14cc8333
commit
046b3450a7
@ -8,7 +8,7 @@ signal bulletDamageSignal(body, bullet)
|
||||
func _ready() -> void:
|
||||
pass # Replace with function body.
|
||||
|
||||
func setSpeed(value)->void:
|
||||
func setSpeed(value:int)->void:
|
||||
speed = value
|
||||
if speed <0:
|
||||
bullet_graphic.flip_h = true
|
||||
|
||||
@ -21,7 +21,7 @@ func _ready() -> void:
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta: float) -> void:
|
||||
func _process(_delta: float) -> void:
|
||||
if Input.is_action_just_pressed("save"):
|
||||
print("Save the game!")
|
||||
if Input.is_action_just_pressed("load"):
|
||||
@ -47,14 +47,13 @@ func buildLevel()->void:
|
||||
|
||||
func updateEnemies()->void:
|
||||
if slimes:
|
||||
var totalSlimes = 0
|
||||
for obj in slimes.get_children():
|
||||
if obj is Slime:
|
||||
totalSlimes +=1
|
||||
Gamecontroller.addEnemyToLevel(obj)
|
||||
#hook up to game controller
|
||||
if not obj.slimeDamageSignal.is_connected(Gamecontroller._on_slime_damage):
|
||||
obj.slimeDamageSignal.connect(Gamecontroller._on_slime_damage)
|
||||
|
||||
func updateCoins()->void:
|
||||
if coins:
|
||||
var totalCoins = 0
|
||||
@ -101,13 +100,14 @@ func teleport(body)->void:
|
||||
var newPosition = Vector2(random_x,random_y)
|
||||
body.teleport_to(newPosition)
|
||||
|
||||
func loadLevel(level:String)->void:
|
||||
get_tree().call_deferred("change_scene_to_file", level)
|
||||
func stashBullet(bullet:Bullet)->void:
|
||||
func loadLevel(levelString:String)->void:
|
||||
get_tree().call_deferred("change_scene_to_file", levelString)
|
||||
|
||||
func stashBullet(bulletToStash:Bullet)->void:
|
||||
var stashPosition:Vector2 = Vector2(-100,100)
|
||||
bullet.position = stashPosition
|
||||
bullet.setSpeed(0)
|
||||
bullet.set_process(false)
|
||||
bulletToStash.position = stashPosition
|
||||
bulletToStash.setSpeed(0)
|
||||
bulletToStash.set_process(false)
|
||||
|
||||
func bulletFactory()->Bullet :
|
||||
var myBullet:Bullet
|
||||
@ -122,9 +122,8 @@ func bulletFactory()->Bullet :
|
||||
|
||||
bulletArray.push_front(myBullet)
|
||||
return myBullet
|
||||
func makeBullet(targetPosition, speed)->void:
|
||||
print("Make a bullet!")
|
||||
print("bullets created: "+str( bulletArray.size() ))
|
||||
|
||||
func makeBullet(targetPosition:Transform2D, speed:int)->void:
|
||||
var myBullet:Bullet = bulletFactory()
|
||||
myBullet.transform = targetPosition
|
||||
myBullet.setSpeed(speed)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user