Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

juaxix juaxix

🏠
Working from home
View GitHub Profile
@juaxix
juaxix / infinite_links.php
Created Apr 26, 2017
Hacker rank - infinite links - Capture the Flag contest - April 2017
View infinite_links.php
View Squash and stretch
--# Main
-- Sandbox
supportedOrientations(LANDSCAPE_ANY)
displayMode(FULLSCREEN_NO_BUTTONS)
--displayMode(OVERLAY)
--displayMode(FULLSCREEN)
function setup()
screen=vec2(WIDTH,HEIGHT)
@juaxix
juaxix / buildaimodels.php
Last active Aug 29, 2015
Shiva :: Create S3DAIModels.cpp file list for Android exports
View buildaimodels.php
<?php
/*
* Example: php5\php.exe buildaimodels.php "C:\\Games\\YourGame\\build\\Android\\eclipse\\jni\\AIModels"
*/
echo "Generating list...\n";
$dir = $argv[1] or "C:\\Games\\YourGame\\build\\Android\\eclipse\\jni\\AIModels";
$dh = opendir($dir);
$txt = "//File generated by juax\n\n\n";
$n = 0;
while (false !== ($filename = readdir($dh))) {
@juaxix
juaxix / shivaFileCount.php
Last active Aug 29, 2015
Shiva - generate line counts for all AI models
View shivaFileCount.php
<?php
/*
Example: > c:\php5\php.exe shivaFileCount.php "c:\Stonetrip\ShiVa Editor Basic\Data\Games\7DFPS_13"
*/
/**
* Scan Resources/AIModels for aim files
* @param string $dir
* @return array
*/
function findAllAI ( $dir ){
@juaxix
juaxix / Game.lua
Last active Jan 1, 2016
Hombert Castle Fall
View Game.lua
--# Main
-- hombert Castle Fall
displayMode(FULLSCREEN)
supportedOrientations(LANDSCAPE_ANY)
-- Use this function to perform your initial setup
function setup()
w = WIDTH/1024
h = HEIGHT/768
useMusic = true
@juaxix
juaxix / Harmony.lua
Created Aug 21, 2013
Lua Harmony :: colaborative drawing
View Harmony.lua
--# Main
supportedOrientations(LANDSCAPE_ANY)
myimage = image(WIDTH,HEIGHT)
setContext(myimage)
function setup()
--backingMode(RETAINED)
toolbox = ToolBox()
@juaxix
juaxix / Main.lua
Last active Dec 21, 2015
Destructible Terrain and water fluids
View Main.lua
-- 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 / Fish.lua
Created Jul 9, 2013
Codea - Fish.lua
View 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 / NetworkLogic.cpp
Last active Dec 19, 2015
Photon Cloud SDK with ShiVa 3D : C++
View NetworkLogic.cpp
#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 / events.vb
Created Mar 14, 2013
3D Electric Fields - Real Basic code -- WIP
View events.vb
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)
You can’t perform that action at this time.