I should probably make that the default in the next release. It will prevent this sort of surprise happening again and people can opt-in to -O3 when needed instead.


Works! So what did I do wrong?


Unless we can come up with a one-size-fits-all format for tilemaps, the conversion is done by a script in the project (scripts/tilemap.js), not by the IDE itself. When you tried to import the TMX file, the IDE doesn’t know what to do with it so it was getting imported as a raw binary.
To make it work I added the missing script and added the “pre-build” step in your project.json.


Could the IDE make some default script on import of the tmx file? The size information is in the tmx-file.


Size information, as in, the size of the map? Is that of any use without the map itself?


I do not have studied the details of the map generation from tmx-file, but just thought if having at least some javascript file as a default (created during importing a tmx file) would be a good idea.


Fixed this bug in tilemap.js:

    int read${layer.name.replace(/[^a-zA-Z0-9_]/g, '')}(int tileX, int tileY){
        pointer addr = this.data + ${4+num*(1+map.width*2*map.height)} + tileY*${map.width*2} + tileX*2;
        return (((int)LDRB(addr)&1)<<8) + LDRB(addr+1);

There was
this.data + ${3
instead of
this.data + ${4


Femto v0.1.0: Compiler errors are much better now :+1:


This doesn’t sound right… does that work on more than one layer?

Edit: I don’t have anything to test this with right now, but it should probably be this instead:
pointer addr = this.data + ${3+(num*(1+map.width*2*map.height)||1)} + tileY*${map.width*2} + tileX*2;

(note the ||1)


The next version of FemtoIDE will bring initial support for PokittoCookies in Java.

For now, cookies can store any primitive type (char, int, long, float, boolean) but nothing that extends Object (classes including String and Array).

For those who are on the bleeding edge, here’s an example of it in use:

import femto.mode.Direct;
import femto.Game;
import femto.State;
import femto.input.Button;
import femto.palette.Psygnosia;
import femto.font.TIC80;

class Score extends femto.Cookie {
        begin("test"); // name of the cookie, up to 8 chars
    int score; // properties you want to save

class Main extends State {
    static final var save = new Score(); // previous value is automatically restored
    static final var screen = new Direct(TIC80.font()); // the screenmode we want to draw with

    public static void main(String[] args){
        Game.run( TIC80.font(), new Main() );
    void init(){

    void update(){
        if( Button.A.justPressed() ){
            save.score = Math.random(0, 1000); // update the score
            save.saveCookie(); // save it to eeprom

        screen.setTextPosition( 0, 0 );
        screen.println("Score: "+save.score); // print the current score


Any way to change the default path of the projects folder? I use more than one computer to dev (one being a VPC) but would like to point them both to the same shared path on my nas/dropbox and when I tried making a shortcut path, the IDE didn’t pick it up.


Look for projectsPath in your config.js and change the value to the path you want.