Skip to content

Instantly share code, notes, and snippets.

View juaxix's full-sized avatar
xixgames

juaxix juaxix

xixgames
View GitHub Profile
@juaxix
juaxix / BezierCurve.lua
Created July 14, 2012 13:01
Fat Duck :: bezier paths - Lua [Codea]
BezierCurve = class()
function BezierCurve:init()
    self:generate_new_bezier()
end
function BezierCurve:draw()
    for i=1,(#self.curve)-1 do
        line(self.curve[i].x,self.curve[i].y,self.curve[i+1].x,self.curve[i+1].y)
@juaxix
juaxix / Main.lua
Created July 16, 2012 15:57
Wavespark from Processing to Lua (Codea - iPad)
-- 
-- xixgames.com
-- LGPL
-- basis
width  = WIDTH
height = HEIGHT
-- images
buffer   = image(width,height)
snapshot = image(width,height)
-- arrays
@juaxix
juaxix / Car.lua
Created July 21, 2012 13:54
2D physic puzzle / sandbox game made in Codea
Car = class()
-- 2D Physics game made in Codea by @juaxix
-- More games: xixgames.com
-- 21/07/2012
-- inspired by Codea Physics tutorial and Crayon Physics :)
function Car:init(x,y) 
    local car = physics.body(POLYGON, vec2(-50,10), vec2(-50,-10), vec2(50,-10), vec2(50,10), vec2(30,10),vec2(25,25),vec2(-25,25),vec2(-30,10))
    car.position = vec2(x, y)
    debugDraw:addBody(car)
    car.density = 2.0
@juaxix
juaxix / Main.lua
Created July 24, 2012 16:29 — forked from anonymous/Main.lua
Slammer Fall Codea Example
--# Emitter
Emitter = class()
function Emitter:init(args)
self.particleMesh = mesh()
self.particleMesh.texture = args.tex
self.minLife = args.minLife or 1
self.maxLife = args.maxLife or 1
self.spread = args.spread or 360
@juaxix
juaxix / Alien.lua
Created December 25, 2012 20:46
Ludum Dare #25 -- You Are The Invader
-- multiplatform Game made for Ludum Dare using Stonetrip ShiVa 3D Engine
-- More info: http://www.ludumdare.com/compo/ludum-dare-25/?action=preview&uid=10960
-- Support developer from XIXGAMES: http://www.xixgames.com @juaxix
--------------------------------------------------------------------------------
function alien.onInit ( )
--------------------------------------------------------------------------------
sensor.setActiveAt ( this.getObject ( ),0,false )
@juaxix
juaxix / events.vb
Created March 14, 2013 11:38
3D Electric Fields - Real Basic code -- WIP
Sub Click(X as integer, Y as integer)
//Clicking on an object on screen selects it in the listbox as well as on screen
dim Obj As PD3DObject
dim ChrgObj As ChargedObject
dim index,i As integer
Obj = PD3DObject(Me.PickedObj(X,Y)) //get the object clicked on
if (Obj <> nil) then
if Obj isA ChargeSphere then //the user has selected a charge config
ChrgObj = ChargeSphere(Obj).parent //trace back from the individual charge to its ChrgObj
for i=0 to ubound(ChrgObjList)
@juaxix
juaxix / NetworkLogic.cpp
Last active December 19, 2015 05:49
Photon Cloud SDK with ShiVa 3D : C++
#include "PrecompiledHeader.h"
#include "NetworkLogic.h"
#if defined _EG_MARMALADE_PLATFORM
# if defined I3D_ARCH_X86
# if(defined _MSC_VER && !defined __clang__ && !defined __gcc__)
# define PLAYER_NAME L"Marmalade X86 Windows"
# else
# define PLAYER_NAME L"Marmalade X86 OS X"
# endif
@juaxix
juaxix / Fish.lua
Created July 9, 2013 11:19
Codea - Fish.lua
Boid = class()
-- constructor used by fish
function Boid:init( _location, _maxSpeed, _maxForce)
self.velocity = vec2( math.random( -maxSpeed, maxSpeed ), math.random( -maxSpeed, maxSpeed ) )
self:createBoid(_location, _maxSpeed, _maxForce)
end
-- constructor used by bubbles
--[[
@juaxix
juaxix / Main.lua
Last active December 21, 2015 03:09
Destructible Terrain and water fluids
-- destructable
-- Use this function to perform your initial setup
function setup()
    parameter.boolean("addWater",false)
    defaultGravity = physics.gravity()
    parameter.boolean("useGravity",false, function(v)
       if v then 
        physics.gravity(Gravity)
       else
@juaxix
juaxix / Harmony.lua
Created August 21, 2013 19:31
Lua Harmony :: colaborative drawing
--# Main
supportedOrientations(LANDSCAPE_ANY)
myimage = image(WIDTH,HEIGHT)
setContext(myimage)
function setup()
--backingMode(RETAINED)
toolbox = ToolBox()