This file contains hidden or 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
| import kha.System; | |
| import kha.Scheduler; | |
| class Main{ | |
| public static function main(){ | |
| System.init({ | |
| title: "dsp", | |
| width: 800, | |
| height: 600, | |
| }, initialized); |
This file contains hidden or 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
| // Given a Vec2 vector class... | |
| function hitPolygonAxis(points: Array<Vec2>, ret: Array<Float>) { | |
| for (i in 0...points.length) { | |
| var a = points[i]; | |
| var b = points[(i+1) % points.length]; | |
| var v = Vec2.make(b.x - a.x, b.y - a.y).normal(); | |
| // we should be able to only use half circunference. | |
| ret.push(v.angle()); | |
| } | |
| } |
This file contains hidden or 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
| class MyClass { | |
| /* | |
| usage: | |
| function x() { | |
| var c = new MyClass(); | |
| var x = c.func(10); | |
| } | |
| */ | |
| macro public function func(ethis: Expr, block: Expr): Expr { |
This file contains hidden or 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
| pico-8 cartridge // http://www.pico-8.com | |
| version 16 | |
| __lua__ | |
| --pecs - pico-8 ecs | |
| --01010111 | |
| function _init() | |
| local rect = get_id() | |
| add_component(rect, 'position', { x=60, y=60 }) | |
| add_component(rect, 'physics', { vx=2, vy=0, ax=0, ay=2, dx=0.9, dy=1.0 }) |
This file contains hidden or 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
| package ; | |
| #if CLIENT | |
| #else | |
| import entities.Flag; | |
| import entities.HealthPack; | |
| import entities.Spawn; | |
| import flixel.util.FlxPoint; | |
| #end |
This file contains hidden or 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
| using OgmoUtils; | |
| class OgmoExample | |
| { | |
| public function new(level_json:String) | |
| { | |
| var data = level_json.parse_level_json(); | |
| var tile_layer = data.get_tile_layer('tiles'); | |
| trace(tile_layer.data2D); |
This file contains hidden or 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
| package; | |
| import motion.actuators.SimpleActuator; | |
| class Game | |
| { | |
| public function new() | |
| { | |
| } | |
This file contains hidden or 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
| // Processing code by Etienne JACOB | |
| // motion blur template by beesandbombs | |
| // opensimplexnoise code in another tab might be necessary | |
| // --> code here : https://gist.github.com/Bleuje/fce86ef35b66c4a2b6a469b27163591e | |
| // note : I found (visually) that there is a little mistake in this rotation version but I haven't found where in the code | |
| // edit : I think I understood the mistake but it's quite annoying to fix :) | |
| int[][] result; | |
| float t, c; |
This file contains hidden or 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
| //testApp.h | |
| #pragma once | |
| #include "ofMain.h" | |
| class testApp : public ofBaseApp{ | |
| public: | |
| void setup(); | |
| void update(); |
This file contains hidden or 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
| #include "ofMain.h" | |
| #include "ofAppGlutWindow.h" | |
| class ofApp : public ofBaseApp { | |
| public: | |
| ofMesh mesh; | |
| ofEasyCam cam; | |
| void setup() { |
OlderNewer