Skip to content

Instantly share code, notes, and snippets.

View KinoAR's full-sized avatar
🏠
Working from home

Kino KinoAR

🏠
Working from home
View GitHub Profile
@KinoAR
KinoAR / godot-script-example.gd
Last active October 10, 2019 00:43
An example of a script for KinematicBody2D that impelements basic player and enemy behavior.
extends KinematicBody2D
export var speed:int = 400
export var health:int = 10
func _physics_process(delta:float)->void:
process_inputs(delta)
pass
func process_inputs(delta)->void:
@KinoAR
KinoAR / godot-types-implicit.gd
Created October 7, 2019 01:44
An example of godot types done implicitly.
# Godot Game Engine Type Example Explicit
# We assume that the type is an int, since 400 has been assigned
var my_speed:= 400
@KinoAR
KinoAR / godot-types.gd
Created October 7, 2019 01:40
Expressing types within the Godot game engine.
# Godot Game Engine Type Example Explicit
var my_speed:int = 400
@KinoAR
KinoAR / godot-types.gd
Created October 7, 2019 01:40
Expressing types within the Godot game engine.
# Godot Game Engine Type Example Explicit
var my_speed:int = 400
@KinoAR
KinoAR / godot-variable.gd
Created October 7, 2019 01:35
An example of a variable in Godot.
# Godot Game Engine Variable Example
var my_speed = 400
@KinoAR
KinoAR / godot-constant.gd
Created October 7, 2019 01:30
An example of a constant variable declaration in Godot.
# A Constant Variable in the Godot Game Engine
const my_speed = 400
@KinoAR
KinoAR / compose.py
Last active September 29, 2019 20:33
Function composabiltiy in Python
# Kino Rose - NierPixel - https://nierpixel.com/
# Composing Functions
def add(num_one:int, num_two:int)->int:
return num_one + num_two
def multiply(num_one:int, num_two:int)->int:
return num_one * num_two
# Three Times Five Composed
@KinoAR
KinoAR / no-return.py
Created September 29, 2019 20:26
An example of a function without a return in Python
# Kino Rose - NierPixel - https://nierpixel.com/
# No Return Function
def secret_addition(num_one:int, num_two:int)->None:
num_one + num_two
pass
@KinoAR
KinoAR / add-function-example.py
Created September 29, 2019 20:23
An example of an addition fucntion in Pyhton.
# Kino Rose - NierPixel - https://nierpixel.com/
# Python Function Example
def add(num_one:int, num_two:int)->int:
return num_one + num_two
@KinoAR
KinoAR / python-example.py
Created September 18, 2019 02:46
Python example to illustrate white space and code structure
def add(x, y):
return x + y
# Returns 4
add(2, 2)