Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

file 56 lines (38 sloc) 2.326 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
= Useful Utilities =

Universal Animation Modifier:
This adds a little base tag to every cube trains object which sets its scale.
./game --utility=query modules/cube_trains 'map(filter(visit_objects(doc), value.animation != null), set(value.animation, [{"@base": true, scale: 1}] + if(is_list(value.animation), value.animation, [value.animation])))'


Search the commit logs for a word, for a given file.
git log --grep=word -- whatever/path


Log Frogatto's console output to a file.
./game --level module-manager.cfg 2>&1 | tee log.txt


Log objects outside the level dimensions.
./game --utility=query modules/cube_trains "
    if(is_list(doc.dimensions),
        map(filter(visit_objects(doc),
                //value.type in ['coin_gold_big','coin_gold_enormous','coin_silver','gold_berry']), 'obj', //Alternative check, useful for Frogatto, for coins.
                value.type and value.x and value.label), 'obj',
            if(not point_in_rect([obj.x, obj.y], doc.dimensions),
                debug('\${doc.id} has a \${obj.type}, \${obj.label}, out-of-bounds at \${[obj.x, obj.y]}.'))
        )) where point_in_rect = def(point, rect) (rect[0] < point[0] and point[0] < rect[2] and //Cloned this function from functions-geometry.cfg sans safety.
                                                   rect[1] < point[1] and point[1] < rect[3])"


Compile Frogatto with shaders:
export CXXFLAGS=-DUSE_GLES2 && make clean && make

Or not:
unset CXXFLAGS && make clean && make


Chart Events Fired:
debug_chart('events', performance().nevents),


Chart all metrics:
    debug_chart('fps', constrain(0, performance().fps, 100)),
    debug_chart('cycles_per_second', constrain(0, performance().cycles_per_second, 100)),
    debug_chart('delay', constrain(0, performance().delay, 100)),
    debug_chart('draw', constrain(0, performance().draw, 100)),
    debug_chart('process', constrain(0, performance().process, 100)),
    debug_chart('flip', constrain(0, performance().flip, 100)),
    debug_chart('nevents', constrain(0, performance().nevent, 100)),
    debug_chart('time', time()%100),
    
    
List authors in git:
git shortlog -sn


Offset an entire Cube Trains map by x/y/z:
set(ctm, <map data>)
ctm + {'map': map(ctm['map'], list_replace_elements(value, 1, [list_add(value[1], offset)] ) )} where offset = [0,0,1]
Something went wrong with that request. Please try again.