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 / Rotations.lua
Last active February 16, 2021 19:02
The Pico-8 code showing off rotations math.
--rotations by eis - kino
--globals
--The sprites, the position (x and y) of both star1 and star2
star1 ={sprite=2, x = 58, y = 58}
star2 ={sprite=3, x = 0, y = 0}
degrees = 0
function _update()
--Here we rotate star2 around star1 by giving rotate star1's position(x, y).
@KinoAR
KinoAR / Flixel-Automatic-build.yaml
Last active February 11, 2021 02:30
Automatic Build File
# This is a basic workflow to help you get started with Actions
name: Build Game
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ master ]
pull_request:
@KinoAR
KinoAR / cutscene-update.hx
Created January 30, 2021 00:09
Update logic for the cutscene example in HaxeFlixel
/**
* Update Code - HaxeFlixel
* Kino Rose
*/
class CutsceneState extends FlxState {
//Code from Before
override public function update(elapsed:Float) {
@KinoAR
KinoAR / cutscene-create.hx
Created January 29, 2021 23:52
Create function for Cutscene
class CutsceneState extends FlxState {
//Additional code from before here
public static inline var TEXT_WIDTH:Int = 400
override public function create() {
createSkip();
createSceneText();
@KinoAR
KinoAR / cutscene-state.hx
Last active January 29, 2021 23:37
Setup for the cutscene-state
package;
//Imports for the FlxState
import flixel.addons.text.FlxTypeText;
import flixel.text.FlxText;
import flixel.FlxState;
// Type Information to create a delay that you want for each individual text that appears on screen
typedef SceneText = {
public var text:String;
@KinoAR
KinoAR / scroll-factor.hx
Created January 20, 2021 22:15
Scroll Factor example Flixel
class PlayerHUD extends FlxTypedGroup<FlxSprite> {
public function create() {
var myGameUIText = new FlxText(0, 0, 100, 'High Score: 0', 12);
//Sets the scroll factor of the game UIText; this prevents it from scrolling in either direction.
//Note: By default buttons have a scrollFactor of 0.
myGameUIText.scrollFactor.set(0, 0);
add(myGameUIText)
}
}
@KinoAR
KinoAR / tags.hx
Last active January 14, 2021 01:19
Tag examples in Haxe.
//In the output although the class is called ScenePause in Haxe, it will be LunaScenePause in the JS output.
@:native('LunaScenePause')
@:expose
class ScenePause extends Scene_MenuBase {
public var pauseTitleWindow: WindowTitle;
public var pauseMenuWindow: WindowPauseMenu;
public var pauseConfirmWindow: WindowConfirmMenu;
public override function create() {
this.createWindowLayer();
@KinoAR
KinoAR / anon.hx
Created January 6, 2021 23:57
Haxe anonymous structure exmaple
var myObj = {
name: 'Timothy',
health: 3
}
//JS Object Example
/*
const myObj = {
name: "Timothy",
health: 3
@KinoAR
KinoAR / haxe-compile-watch.sh
Created December 14, 2020 23:24
Haxe Compilation Nodemon Watch
nodemon --watch src -e hx,hxml,xml --exec haxe --times --connect 7010 compile.hxml
@KinoAR
KinoAR / haxe-build-command.sh
Created December 14, 2020 23:21
Haxe Compilation Command
haxe --wait 7010