Added Glitch Room Source code to Gitty
This commit is contained in:
commit
1ac9eb5644
505 files changed
+28504
No files matched your search
@@ -0,0 +1,29 @@
|
||||
extends SceneTree
|
||||
func _initialize() -> void:
|
||||
call_deferred("run")
|
||||
func run() -> void:
|
||||
var game=load("res://games/galaga/Galaga.tscn").instantiate()
|
||||
root.add_child(game)
|
||||
game.set_physics_process(false)
|
||||
game.start_game()
|
||||
var events := []
|
||||
game.game_won.connect(func(): events.append("won"))
|
||||
game.state="playing"
|
||||
game._bullet(Vector2(100,200),Vector2(0,-100),true)
|
||||
game.win_game()
|
||||
assert(game.state=="victory" and events.is_empty())
|
||||
game._tick(0.5)
|
||||
assert(game.bullets[0].node.position.y==150)
|
||||
assert(game.state=="victory")
|
||||
game.win_game()
|
||||
game._tick(1.01)
|
||||
assert(game.state=="won" and not game.is_running and events.size()==1)
|
||||
var before: float=game.clock
|
||||
game._physics_process(0.5)
|
||||
assert(game.clock>before)
|
||||
game.reset_game()
|
||||
assert(game.state=="idle")
|
||||
print("VICTORY TRANSITION PASS")
|
||||
game.queue_free()
|
||||
await process_frame
|
||||
quit()
|
||||
Reference in new issue
Block a user