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,25 @@
|
||||
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.state="playing"
|
||||
game.player.position=Vector2(112.1,256.1)
|
||||
await process_frame
|
||||
await process_frame
|
||||
await RenderingServer.frame_post_draw
|
||||
var first := root.get_texture().get_image().get_data()
|
||||
game.player.position=Vector2(112.4,256.4)
|
||||
await process_frame
|
||||
await process_frame
|
||||
await RenderingServer.frame_post_draw
|
||||
assert(first==root.get_texture().get_image().get_data(),"Fractional positions within the same native pixel must render identically")
|
||||
game.player.position=Vector2(112.7,256.7)
|
||||
await process_frame
|
||||
await process_frame
|
||||
await RenderingServer.frame_post_draw
|
||||
assert(first!=root.get_texture().get_image().get_data(),"Crossing a native pixel boundary must move the rendered sprite")
|
||||
print("NATIVE PIXEL RENDER TEST PASS")
|
||||
quit()
|
||||
Reference in new issue
Block a user