Skip to content

Instantly share code, notes, and snippets.

@pajlada
pajlada / gist:8985c505ec82ea8659a7
Created May 8, 2014 07:19
Principia Robot Manager description
IN0: Godmode ON/OFF.
IN1: Speed modifier (0.0-1.0). Only enabled if the cable is plugged in. A value of 0.0 means the robot is unable to walk.
IN2: Disable action (useful for disabling box mode until certain powerup is enabled).
IN3: Jump strength multiplier.
IN4: HP increase (heal), value * 10
IN5: HP decrease (damage), value * 10
IN6: Max HP increase, value * 10
IN7: Max HP decrease, value * 10
IN8: Weapon damage multiplier 0.0 = No extra damage, 1.0 = 5 times the damage.
IN9: Toggle robot action.
@pajlada
pajlada / gist:38eb49973e0ca57f891e
Created May 19, 2014 23:05
Principia javascript Image to Lua array
function clear_me()
{
var img_info = Sizzle('#content .nospace')[0];
var img_help = Sizzle('#content .help')[0];
$S(img_info, {'display': 'none'});
$S(img_help, {'display': 'none'});
var code_container = $('code_container');
$S(code_container, {'display': 'none'});
local v = this:read(0)
v = v * 2.0
if v >= 1.0 then
this:write(0, v-1.0)
this:write(1, 0.0)
else
this:write(0, 0.0)
this:write(1, 1.0-v)
end
@pajlada
pajlada / gist:facf54f2add206ac26e6
Created August 13, 2014 13:23
Robot Manager description
Controls or outputs information about the selected robot.
IN0: Godmode ON/OFF.
IN1: Speed modifier (0.0-1.0). Only enabled if the cable is plugged in. A value of 0.0 means the robot is unable to walk.
IN2: Disable action (useful for disabling box mode until certain powerup is enabled).
IN3: Jump strength multiplier.
IN4: HP increase (heal), value * 10
IN5: HP decrease (damage), value * 10
IN6: Max HP increase, value * 10
IN7: Max HP decrease, value * 10
@pajlada
pajlada / gist:438fdde9f4c742f9af06
Created August 23, 2014 11:56
Principia LuaScript on_input
function on_input(type, data)
end
Type can be:
INPUT_KEY_DOWN
INPUT_KEY_UP
INPUT_POINTER_DOWN
INPUT_POINTER_UP
Data is a table, containing data depending on the input type.
-- First luascript (id 5)
function my_custom_function()
local id1 = 5
local id2 = 10
local id3 = 20
return id1, id2, id3
end
-- old code:
if this:first_run() then
-- do A
end
-- do B
@pajlada
pajlada / gist:2c45db7c7a2b8614811c
Created August 26, 2014 09:44
Changes 1.5.0.2 (android only)
Multiselect config dialog fixed for Android
Rockets no longer trigger explosives in other layers (1.5 and up only)
Tuned quadruped leg damage
Bugfix: It's now possible to disconnect from RCs in adventure mode
Ladder steps can now be zapped
Multi-importing old objects should now work flawlessly.
portrait mode fixed
@pajlada
pajlada / gist:23ba84ebc20fd54654b5
Created September 15, 2014 23:41
on_event example
-- Available events:
-- 0 = Player die
-- 1 = Enemy die
-- 2 = Interactive Destroy
-- 3 = Player respawn
-- 4 = Click down (still available, although on_input is more useful)
-- 5 = Click up (still available, although on_input is more useful)
-- 6 = Absorber or Mini absorber absorbed something
-- 7 = Level Completed
-- 8 = Game Over
Users with top K@tys are:
1. acheron12 (38,256)
2. vengepk (29,530)
3. mysticseven (28,612.5)
4. bluefire4101 (26,993)
5. synfull_(25,865)
6. asteconn (23,618.5)
7. noxnoob (17,446)
8. slikone12 (12,983)
9. pajlada (12,300)