File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,13 @@ func _ready():
3737 audio .play ()
3838 audio .finished .connect (audio .play )
3939
40+ func _input (event ):
41+ if event .is_action_pressed ("ui_fullscreen" ):
42+ var win_full = DisplayServer .window_get_mode () == DisplayServer .WINDOW_MODE_FULLSCREEN
43+ DisplayServer .mouse_set_mode (DisplayServer .MOUSE_MODE_VISIBLE if win_full else DisplayServer .MOUSE_MODE_HIDDEN )
44+ DisplayServer .window_set_mode (DisplayServer .WINDOW_MODE_WINDOWED if win_full else DisplayServer .WINDOW_MODE_FULLSCREEN )
45+
46+
4047func _process (delta ):
4148 map_clock .x += delta
4249 # title screen is the first level, and "game complete" screen is the last level:
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ class_name Goober
66
77var game
88var spd := 30.0
9- var vel := Vector2 (spd , 1 )
9+ var vel := Vector2 (spd , 0 )
1010var flip_clock := 1.0
1111
1212func _enter_tree ():
@@ -27,7 +27,9 @@ func _physics_process(delta):
2727 if ! raycast .is_colliding ():
2828 flip ()
2929
30- velocity = vel
30+
31+ move_and_collide (Vector2 (0 , 1 ))
32+ velocity = Vector2 (vel .x , 0 )
3133 move_and_slide ()
3234 if velocity .x == 0 :
3335 flip ()
You can’t perform that action at this time.
0 commit comments