Blog

  • Sprites explained

    Sprites are saved in Aseprite as a spritesheet with a json file and tga/png for each separate animation. Name the json and image the same. Now once you have all your animations saved, put them all in a directory together and in that directory create a file called sprite.json:

    [ walk_e, walk_w, walk_n, walk_s, throw, jump ]

    List all your animations in an array in a json file like above. Now to load a sprite, use the directory name with sprite_load. Make sure to put sprites in data/gfx/sprites.

  • BooBoo 3.0.7

    • Move cfg docs to core docs
    • Add casts to make maps in some examples work.

    As I previously said, now that types aren’t explicitly set, sometimes you need a cast. Example old code:

    map m
    = [m "draw"] my_draw

    This becomes:

    var m
    = m (map m)
    = [m "draw"] my_draw

  • BooBoo License

    BooBooCLI is now free. If you want to distribute BooBoo (game engine) with your game you must buy it on Humble.

  • BooBoo 3.0.6

    • Prioritize command line switches over shim5.json. Make many command line switches available in shim5.json (see devsettings for everything, run with +debug command line switch then press F9 to get devsettings.)
    • Add break and continue for for loops
    • +adapter command line switch is removed, it never worked with OpenGL
    • Changed default samplerate to 48000 Hz as that seems to be the default for quite a while now

  • BooBoo 3.0.5

    • More legible fps/ops/s
    • Fix print, string_format and file_print when printing expressions
    • Allow an expression to start a container indexing operation
    • Added set_blend_mode and constants
    • Add ‘limits’ command line switch to shim5.json/devsettings
    • Add blend example (seen below)
  • Colour blending modes

    resize 1280 720
    
    var font
    = font (font_load "font.ttf" 16 1)
    
    var src dest
    = src BLEND_ONE
    = dest BLEND_INVSRCALPHA
    
    var sphere
    = sphere (image_load "sphere.png")
    
    var spheres v i
    for i 0 (< i 10) 1 again
    	vector_init v (rand 0 1280) (rand 0 720) (- (rand 0 2) 1) (- (rand 0 2) 1)
    	vector_add spheres v
    :again
    
    var name_map	
    vector_add name_map "BLEND_ZERO"
    vector_add name_map "BLEND_ONE"
    vector_add name_map "BLEND_SRCCOLOR"
    vector_add name_map "BLEND_INVSRCCOLOR"
    vector_add name_map "BLEND_SRCALPHA"
    vector_add name_map "BLEND_INVSRCALPHA"
    
    function tostr n
    {
    	return [name_map n]
    }
    function draw
    {
    	set_blend_mode src dest
    
    	var i
    	for i 0 (< i 10) 1 again
    		image_draw sphere 255 255 255 255 (- [spheres i 0] (/ [(image_size sphere) 0] 2)) (- [spheres i 1] (/ [(image_size sphere) 1] 2))
    	:again
    	
    	set_blend_mode BLEND_ONE BLEND_INVSRCALPHA
    	var s
    	= s (string_format "SRC: % DEST: %" (tostr src) (tostr dest))
    	font_draw font 0 0 0 255 s 11 10
    	font_draw font 0 0 0 255 s 10 11
    	font_draw font 0 0 0 255 s 11 11
    	font_draw font 255 255 0 255 s 10 10
    }
    
    function run
    {
    	var i
    	for i 0 (< i 10) 1 again
    		= [spheres i 0] (+ [spheres i 0] [spheres i 2])
    		= [spheres i 1] (+ [spheres i 1] [spheres i 3])
    		if (< [spheres i 0] 0) pos_x (< [spheres i 1] 0) pos_y (>= [spheres i 0] 1280) neg_x (>= [spheres i 1] 720) neg_y
    			= [spheres i 0] 0
    			= [spheres i 2] (neg [spheres i 2])
    		:pos_x
    			= [spheres i 1] 0
    			= [spheres i 3] (neg [spheres i 3])
    		:pos_y
    			= [spheres i 0] 1279
    			= [spheres i 2] (neg [spheres i 2])
    		:neg_x
    			= [spheres i 1] 719
    			= [spheres i 3] (neg [spheres i 3])
    		:neg_y
    	:again
    }
    
    function event type a b c d
    {
    	if (== type EVENT_KEY_DOWN) check_key
    		if (== a KEY_UP) up (== a KEY_DOWN) down (== a KEY_LEFT) left (== a KEY_RIGHT) right
    			= src (- src 1)
    			if (< src 0) wrap1
    				= src 5
    			:wrap1
    		:up
    			= src (+ src 1)
    			= src (% src 6)
    		:down
    			= dest (- dest 1)
    			if (< dest 0) wrap3
    				= dest 5
    			:wrap3
    		:left
    			= dest (+ dest 1)
    			= dest (% dest 6)
    		:right
    	:check_key
    }
  • BooBoo 3.0.4

    • font_draw accepts and rtl boolean for RTL text
    • Return -1 on fail on load/create funcs
    • Move cfg API to standard lib so it can be used by BooBooCLI
  • You’ve never failed

    Because you’re 30-40 years old and have never left your safe space. I faced more adversity by the time I was 3 than you ever will. Lol. Hilarious you comparing yourself to me.

  • BooBoo 3.0.3

    • if you declare a constant vector (through initialisation), its elements are now constant

    e.g.

    const v (identity 4)
    = [v 1 1] 2 ; fail
  • BooBoo 3.0.2

    • Added const. Functions and labels are always constant.
    • * is now the dereference operator.