Skip to content

Instantly share code, notes, and snippets.

View daverave1212's full-sized avatar

David Irimia daverave1212

View GitHub Profile
@daverave1212
daverave1212 / PlaneTriangleUtils.cs
Created April 15, 2020 22:02
Remove triangles and squares from a 3D plane object.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
/*
* How to use:
* .DestroySquareAtPosition( Vector3 ) //
* .DestroyTriangleAtPosition( Vector3 ) // Returns true if a triangle was found;
*
*/
@daverave1212
daverave1212 / Web Dev DAW.md
Last active January 18, 2020 10:48
Web Dev DAW
@daverave1212
daverave1212 / Log.hx
Created December 19, 2018 00:54
This class shows a special 'console' directly on your screen. Use Log.go(...)
/*
Stencyl exclusively uses the Haxe programming language.
Haxe is similar to ActionScript and JavaScript.
Want to use native code or make something reusable? Use the Extensions Framework instead.
http://www.stencyl.com/help/view/engine-extensions/
Learn more about Haxe and our APIs
http://www.stencyl.com/help/view/haxe/
*/
@daverave1212
daverave1212 / TextInput.hx
Last active December 17, 2018 17:56
Should work like HTML input tags. Not complete. To do: styling with CSS
// BACKUP
package scripts;
import com.stencyl.graphics.G;
import com.stencyl.behavior.Script;
import com.stencyl.behavior.Script.*;
@daverave1212
daverave1212 / CameraScroller.hx
Last active December 16, 2018 16:17
A static class that enables mobile camera scrolling. One line of code "CameraScroller.initialize()" and it's all set up!
package scripts;
import com.stencyl.behavior.Script;
import com.stencyl.behavior.Script.*;
import com.stencyl.behavior.ActorScript;
import com.stencyl.behavior.SceneScript;
import com.stencyl.behavior.TimedTask;
@daverave1212
daverave1212 / Texts.hx
Created December 14, 2018 01:28
Static class, splits a string by delimiters (like it should be by default!)
package scripts;
class Texts
{
public static function stringContains(s : String, letter : String){
for(i in 0...s.length){
if(s.charAt(i) == letter){
return s.charAt(i);
@daverave1212
daverave1212 / ParticleSpawner.hx
Last active December 22, 2018 00:53
Updated to be much cooler! Still WIP
/* NOTE: Requires:
Queue.hx
Texts.hx
*/
/*
How to use:
var p = new ParticleSpawner(
fileNameWithExtension : String, // Ex: "image.png"
x : Float,
@daverave1212
daverave1212 / Queue.hx
Created December 13, 2018 00:17
A simple Queue class. var q : Queue<T> = new Queue<T>() q.push(x) q.pop() trace(q.peek()) trace(q.length) trace(q.last)
package scripts;
class Node<T>{
public var data : T;
public var next : Node<T> = null;
public function new(d : T){
data = d;
}
@daverave1212
daverave1212 / FloatingTextManager.hx
Last active December 11, 2018 17:32
A neat class, great for combat and RPG games with floating combat text!
package scripts;
import com.stencyl.graphics.G;
import com.stencyl.behavior.Script;
import com.stencyl.behavior.Script.*;
import com.stencyl.behavior.ActorScript;
import com.stencyl.behavior.SceneScript;
import com.stencyl.behavior.TimedTask;