Recent community posts
Thanks! I kinda ran out of time for adding more sounds or more varied sounds because I didn't have the full 48 hours to dedicate to the game but I totally agree!
You can't throw the sticky notes out the window though! You only have one finger and the car only has levers, it would take ages to lower the window!
This is less of a hack and more of "I'm too lazy to do it the right way"
I'm using Godot for my entry https://mrcdk.itch.io/only-one-finger-driver-mark
Godot UI system is really powerful (the Godot's editor is made with the same UI parts you have access in the engine) so I used them to create all the "GUI" elements in the game. My game gimmick is that you only have one finger so I wanted the cursor to be that, only one finger. Each UI element in Godot has a property to select the mouse cursor it will use (the arrow, the pointing hand,...) when you are interacting with it. Because my game uses a lot of those elements, changing the cursor mode to each one would take a while... unless you are me and do this in a autoload/singleton (in Godot, a node that loads at the beginning before the scene is loaded and is always loaded) :
func _enter_tree(): # a function called by the engine when the node first enters the scene tree
# set the default cursor to pointing hand
Input.set_default_cursor_shape(Input.CURSOR_POINTING_HAND) # load a custom graphic for the cursor Input.set_custom_mouse_cursor(preload('res://assets/hand.png'), Input.CURSOR_POINTING_HAND, Vector2(17, 5))
# connect the scene tree "node_added" signal to the function "_on_node_added"
get_tree().connect("node_added", self, "_on_node_added")
func _on_node_added(node): # the function connected to the scene tree "node_added" signal
if node is Control: # if the node added is a Control (base class for all UI elements in Godot)
node.mouse_default_cursor_shape = Control.CURSOR_POINTING_HAND # Set its default cursor to be a pointing hand
Part of https://github.com/mrcdk/gmtk_gamejam_2019/blob/master/Globals.gd
This way, I made sure that the cursor will always be the pointing hand one and didn't have to worry about adding new UI elements.
Another "I'm too lazy" moment was inputing the text in the fields. I really didn't want to code an input field from scratch... so... I created fake input key events when clicking on the on-screen "keyboard" buttons here https://github.com/mrcdk/gmtk_gamejam_2019/blob/master/Keyboard.gd and blocked all the input events that came from the physical keyboard:
if event is InputEventKey and not event.has_meta('fake'):
Part of https://github.com/mrcdk/gmtk_gamejam_2019/blob/master/Main.gd
Notice how I set metadata in the fake key event I generate in keyboard.gd and only consume the input key events that aren't marked by that metadata (all the ones triggered by the physical keyboard)
So, some explanation on how this work. In Godot the input event system has the following flow explained in the documentation. As you can see, first the _input() function will process the event and, if the event isn't handled, then the GUI input will process it. Because I'm dealing with GUI elements, if I handle the input event in an _input() function I'll be sure that the event won't reach any GUI element. Put 2 and 2 together and that's how I did it.
Yeah, it's annoying by design. I had a more annoying version of it in my head (like you lose if you crash once) but I toned it down because it removed the bit of fun that the game had. Thanks for the comment!