This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Video: https://www.youtube.com/watch?v=oCMOYS71NIU | |
Based on Neil Kolban example for IDF: https://github.com/nkolban/esp32-snippets/blob/master/cpp_utils/tests/BLE%20Tests/SampleNotify.cpp | |
Ported to Arduino ESP32 by Evandro Copercini | |
Gamepad coding by Game Dragon | |
*/ | |
#include <BLEDevice.h> | |
#include <BLEServer.h> | |
#include <BLEUtils.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extends KinematicBody2D | |
var walk_speed = 500 | |
var direction = Vector2(0,0) | |
func _ready(): | |
set_fixed_process(true) | |
Globals.set("player", self) # We make the player accessible more easily through Globals. | |
func _fixed_process(delta): | |
# Simple movement for our char |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Created by BrunoSXS | |
# LICENSED UNDER MIT | |
var save_slot = 0 # Just like classic JRPs, change the slot to save in a different place | |
var current_save_game # This is the contents of the save file, for now we just declare it | |
var default_save = {"money":0,"powers":null} # The default save contents, if there is no save file to load, then, the current_save_game gets its contents from this variable and then creates a save file with it | |
func _ready(): | |
current_save_game = load_game(save_slot) if typeof(load_game(save_slot)) == TYPE_DICTIONARY else default_save # This is the first loading, when the game starts. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Available only in the 2.2 legacy branch and posterior versions | |
func _ready(): | |
# The old way: | |
print("HELLO") # Code before the yield | |
# Setting up the yield: | |
var t = Timer.new() # Create a new Timer node | |
t.set_wait_time(5.5) # Set the wait time | |
add_child(t) # Add it to the node tree as the direct child |