Skip to content

Instantly share code, notes, and snippets.

@ansimuz
ansimuz / Idle.gd
Created July 17, 2024 20:09
State Machine example for Godot 4
extends State
# Idle State example for the player
func handle_input(event: InputEvent) -> void:
pass
func update(delta: float) -> void:
owner.apply_gravity(delta)
owner.move_player()
@ansimuz
ansimuz / gist:b84dc5770080f9c5fefa
Created November 25, 2014 06:12
Ouya gamepad untested
ig.module(
'game.plugins.ouya-gamepad'
)
.requires(
'impact.input',
'impact.game'
)
.defines(function(){
// Assign some values to the Gamepad buttons. We use an offset of 512
ig.module(
'game.plugins.gamepad'
)
.requires(
'impact.input',
'impact.game'
)
.defines(function(){
// Assign some values to the Gamepad buttons. We use an offset of 256