TAS mode for Javitto (development thread)

I’d like to start this Topic as a development thread for getting a working TAS Mode for Javitto.

Current modes available in Javitto here: https://github.com/felipemanga/FemtoIDE/tree/master/javacompiler/femto/mode

PokittoLib TASMODE:

5 Likes

Started a new Sample project and created a quick TasScreen.java and copied all of the HiRes16Color.java logic into it.

Immediately ran into

Could not find matching draw inside Image. Candidates rejected. 
Can not convert: TasScreen into HiRes16Color screen, TasScreen into LowRes256Color screen, 
TasScreen into Direct4BPP screen

which is not surprising at all when there is no implementation of my TasScreen in the Image.java class :smiley:

This means it’ll need to be added to other classes looking for screen modes as well.
Such as Sprite.java

3 Likes

Ok, so I doinked up and reinstalled my OS. So coming at this fresh :man_facepalming:

@tuxinator2009 would you happen to have any links or resources to learning linefillers? Since I think that’s the crucial step to get this up and running.

a quick study for an API and how I’d do it!

This is a lot of works organizing stuff, so I suggest the following constraints at first:

  • Stick to hires or lowres. Don’t attempt doing both at the same time
  • No skip for the filler. It’s an advanced use that is only useful when using the masks.
  • When a single resolution is fully supported with this constraint, that’ll be very good already!

I’d make a TASMode with the following things

  • Choose either hires / lowres and stick to it until you’d finished everything.
    • when everything work, you’ll be able to support the missing one.
  • A list of LineFiller (which would be iterated)
  • Each LineFiller is a layer of TASMode - and the user can customize them by having direct access to that array (e.g. LineFiller[] fillers = new LineFiller[4];)
    • You’d have a single method void fillLine(byte[] line, int y) to be implemented by complying classes.
    • As a reminder:
      • line contains your 110(lowres)/220(hires) pixels in 8bpp values.
      • y is the Y coordinate on the screen, 0 for the first lineadvance their position, especially the Sprites & Tiles ones, so it’s important to keep this behavior.
  • Additional class - OpaqueTileFiller - an implementation of LineFiller - which renders a tilemap sufficient to cover the screen + offsets
  • Additional class - SpritesFiller - an implementation of LineFiller that allows the drawSprite with mirror etc
  • Additional class - ColorFiller - an implementation of LineFiller which simply copy the same color (which can be changed at runtime) to the whole line
  • And of course a few examples

ideally you’d setup it like this

TASMode videoMode = new TASMode();
OpaqueTileFiller tilesFiller = new OpaqueTileFiller();
SpritesFiller spritesFiller = new SpritesFiller();

...

videoMode.fillers[0] = tilesFiller;
videoMode.fillers[1] = spritesFiller;

...

// rendering with Tiles
tilesFiller.setOffset(1, 3); // should be checked against "outside the map".
tilesFiller.setTile(0, 0, ?TileData?); // manually change a given screen tile
tilesFiller.draw(tilemap); // A Tilemap that smartly knows which tiles to update automatically.

// rendering with Sprites
spritesFiller.drawSprite(10, 2, ?SpriteData?);
spritesFiller.drawRect(4, 42, 2, 42, COLOR); // Renders a color.

About the order of implementation, since it’s big, it’s best to split into intermediate steps:

  • Start with TASMode, with no filler - just reproduce a color fill.

  • Right after, add the LineFiller interface, with a field of new LineFiller[] in your TASMode inside, and port your hard-coded color fill into the ColorFiller.

    • additionally, you could provide a RandomColorFiller() which would output a rand() for each pixel to make sure things are done properly!
  • For SpritesFiller - you’d have to port the list of draw operations into a c++ class somehow - you should be able to port most things easily, maybe by using slightly more memory.

  • For TilesFiller - it’s pretty much the same, but you’d port the screentilemap instead

  • When you’re done all of this, you’ll have enough vision to know how to to the other resolution (lowres if you chose hires), masking and other advanced stuff!

4 Likes

Finally had some time to give this a go and I can’t seem to figure out how to get an interface to compile in Javitto :laughing: so… that’s a challenge.

1 Like

Oke doke, after some flubbing about and getting many corrections from the live chat, I’ve got something I think is working:
image

in the TASMode.java I have working it just does this right now:

    void flushLine(short[] line, int y){
        beginStream();
        for(int x = 0; x < line.length; ++x){
           writeData(line[x]);
        }
    }

Which is significantly better than what I was doing there hehe.

Just about ready I think to start getting serious on this thing.

6 Likes

Pushed the repo to github if anyone is interested in following along or :eyes: helping a guy out hehe.

As of right now we have:

  • TASMode.java - Which, simply is a “screen” mode that has a LineFiller with only one filler in it (the ColorFiller)
    • The real magic happens in the flush() and flushLine() methods. We loop over the height of the screen (176) and for each line we run the fillers’ flilLine(line,y) methods. Then we flushLine to the screen itself, which simply writes the data to each x coordinate in the line length.
void flush() {
        short[] line = new short[220];
        for(int y = 0; y < 176; ++y){
            for(LineFiller lf : fillers){
                if(null == lf)continue;
                lf.fillLine(line, y);
            }
            flushLine(line, y);
        }
    }
    
    void flushLine(short[] line, int y){
        beginStream();
        for(int x = 0; x < line.length; ++x){
            writeData(line[x]);
        }
    }
  • ColorFiller.java - Not too impressive, simply fills a line with random colors as of right now (Really fun to watch. Pixels!)

Next up I’d like to start poking at the TileFiller! Which will be interesting. I’m going to be doing a lot of tinkering and reading around the Tas BGFiller
Thank goodness the code for TAS is already here and it is just a matter of “translating” it :eyes:

1 Like

Started the SpriteFiller logic.

  • Added a draw command for TASmode screen in Sprite.java. So far it just gets the frame and tries to add it to the TASMode screen using addSprite in TASMode.java, which currently does not do anything.
  • Just stubbed out a bunch of stuff (like SpriteFiller.flushLine, addSprite, etc…)
4 Likes

We have a sprite! It… Is… ALIVE!

Behold. Majestic…

4 Likes

Great progress!

2 Likes

Thank you! Felt really good to see that little dog running lol.

Things coming up to work on:

  • a buffer of “Sprites” that can be iterated over and drawn (instead of just using SpriteFiller.java as a single sprite drawing… thing)
  • Adding more sprite features (mirror, flip, etc…)
  • Make it work better (make sure performance doesn’t just dip for poorly optimized code and such…)

Some other items I’d like to figure out:

  • getting the javitto “pause” system menu to work. Might just be the emulator (since I reproduced on the hello java project) but trying to open the menu in the emulator freezes it.
  • not sure where to call beforeFlush.
2 Likes

Got flip, mirror and clipping at the edges all working. Also added the missing offsets for x/y :eyes: heh…

Now has a sprite buffer so multiple sprites can be added instead of just one :smiley:

Still not sure how to get the pause working, as I would have to have that checked on hardware since I cannot get it to work in the emulator (even on other projects like Hello Java)

Next coming: TileFiller! ! !

5 Likes

Been running into a mental block trying to take a stab at Tiles.

I’ve been trying to plan out how to represent the data of the tiles based on the tmx files from Tiled. Using the Tilemap Converter from the current TASMode project I can save the data easily enough as basic binary arrays (like how I do save files in Moondrop Dale). The only problem is I’m not at all sure how this should look in practice. :thinking:

1 Like

Knowing nothing about the TAS line filler, but if you have the tile data somewhere and the tilemap somewhere, then you should do for each screen line:

  • figure out what tile you are in from the tilemap
  • figure out what is the source line in the tile data
  • copy the horizontal pixels from the tile to the screen line
  • repeat the above for the remaining pixels of the screen line
1 Like

My challenge is prior to these steps :slight_smile: I’m trying to figure out how to represent the data. Since the tasmode way has a nice simple maps.h file it generates, but maybe I want to split the 3 different pieces into their own files (map width,height,tile places then the enum for data like collisions etc, then the tile data which will be the weirdest one to do I think)

Ok so I started making the convert script generate a Java file, similar to the maps.h file, except it is a Java class TileMaps.java with some static methods for getting the different Data necessary.

// Generated File - DO NOT EDIT
public class TileMaps {
	static byte EMPTY = 0;
	static byte Collide = 1 << 0;
	static byte WalkOnGrass = 1 << 1;
	static byte GoToTitle = 1 << 2;

    // get Map 0:width, 1:height, map...
    
    public static pointer getGardenPath(){
        pointer ptr;
        __inline_cpp__("
        static const uint8_t gardenPath[] = {
        14, 11,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00,
0x02, 0x03, 0x03, 0x03, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00,
0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x01, 0x01, 0x01, 0x01, 0x06, 0x07, 0x01, 0x00,
0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x01, 0x01, 0x01, 0x08, 0x09, 0x01, 0x00,
0x0a, 0x0b, 0x0b, 0x0b, 0x0c, 0x04, 0x04, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00,
0x00, 0x01, 0x01, 0x01, 0x01, 0x0c, 0x04, 0x04, 0x05, 0x01, 0x01, 0x01, 0x01, 0x00,
0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x0c, 0x04, 0x04, 0x05, 0x01, 0x01, 0x01, 0x00,
0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x0c, 0x04, 0x04, 0x05, 0x01, 0x0d, 0x0e,
0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x0c, 0x04, 0x04, 0x05, 0x0f, 0x10,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x04, 0x04, 0x04, 0x04
        };
        ptr = gardenPath;
        ");
        return ptr;
    }


    public static byte gardenPathData(int x, int y){
        byte ptr;
        __inline_cpp__("
        static const signed char parameters[] = {
            Collide,
	Collide,
	Collide,
	Collide,
	Collide,
	Collide,
	Collide,
	Collide,
	Collide,
	Collide,
	Collide,
	Collide,
	Collide,
	Collide,
	Collide,
	WalkOnGrass,
	WalkOnGrass,
	WalkOnGrass,
	WalkOnGrass,
	WalkOnGrass,
	WalkOnGrass,
	WalkOnGrass,
	WalkOnGrass,
	WalkOnGrass,
	WalkOnGrass,
	WalkOnGrass,
	WalkOnGrass,
	Collide,
	Collide,
	EMPTY,
	EMPTY,
	EMPTY,
	EMPTY,
	WalkOnGrass,
	WalkOnGrass,
	WalkOnGrass,
	WalkOnGrass,
	WalkOnGrass,
	WalkOnGrass,
	WalkOnGrass,
	WalkOnGrass,
	Collide,
	GoToTitle,
	EMPTY,
	EMPTY,
	EMPTY,
	EMPTY,
	EMPTY,
	WalkOnGrass,
	WalkOnGrass,
	WalkOnGrass,
	WalkOnGrass,
	Collide,
	Collide,
	WalkOnGrass,
	Collide,
	GoToTitle,
	EMPTY,
	EMPTY,
	EMPTY,
	EMPTY,
	EMPTY,
	EMPTY,
	WalkOnGrass,
	WalkOnGrass,
	WalkOnGrass,
	Collide,
	Collide,
	WalkOnGrass,
	Collide,
	Collide,
	EMPTY,
	EMPTY,
	EMPTY,
	EMPTY,
	EMPTY,
	EMPTY,
	EMPTY,
	WalkOnGrass,
	WalkOnGrass,
	WalkOnGrass,
	WalkOnGrass,
	WalkOnGrass,
	Collide,
	Collide,
	WalkOnGrass,
	WalkOnGrass,
	WalkOnGrass,
	WalkOnGrass,
	EMPTY,
	EMPTY,
	EMPTY,
	EMPTY,
	WalkOnGrass,
	WalkOnGrass,
	WalkOnGrass,
	WalkOnGrass,
	Collide,
	Collide,
	WalkOnGrass,
	WalkOnGrass,
	WalkOnGrass,
	WalkOnGrass,
	WalkOnGrass,
	EMPTY,
	EMPTY,
	EMPTY,
	EMPTY,
	WalkOnGrass,
	WalkOnGrass,
	WalkOnGrass,
	Collide,
	Collide,
	WalkOnGrass,
	WalkOnGrass,
	WalkOnGrass,
	WalkOnGrass,
	WalkOnGrass,
	WalkOnGrass,
	EMPTY,
	EMPTY,
	EMPTY,
	EMPTY,
	WalkOnGrass,
	WalkOnGrass,
	Collide,
	Collide,
	WalkOnGrass,
	WalkOnGrass,
	WalkOnGrass,
	WalkOnGrass,
	WalkOnGrass,
	WalkOnGrass,
	WalkOnGrass,
	EMPTY,
	EMPTY,
	EMPTY,
	EMPTY,
	EMPTY,
	GoToTitle,
	Collide,
	Collide,
	Collide,
	Collide,
	Collide,
	Collide,
	Collide,
	Collide,
	Collide,
	EMPTY,
	EMPTY,
	EMPTY,
	EMPTY,
	GoToTitle
        };
            
        ptr = (x >= 14 || y >= 11) ? EMPTY : parameters[y * 14 + x];
        ");
        return ptr;
    }


    
    public static int[] getTile(int id){
        int[] ptr;
        __inline_cpp__("
        static const uint8_t tiles[] = {
// 0: 2:1,1:437
0x89,0x88,0x88,0x88,0x88,0x89,0x98,0x98,
0x99,0x88,0x88,0x98,0x98,0x88,0x88,0x88,
0x98,0x88,0x99,0x99,0x99,0x88,0x88,0x89,
0x88,0x88,0x89,0x99,0x98,0x88,0x89,0x88,
0x88,0x88,0x98,0x99,0x89,0x88,0x88,0x89,
0x88,0x88,0x88,0x98,0x88,0x88,0x88,0x89,
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x98,
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x98,
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
0x88,0x88,0x88,0x88,0x88,0x88,0x89,0x98,
0x89,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
0x89,0x99,0x98,0x8c,0x89,0x99,0x99,0x99,
0x99,0x99,0x98,0xcc,0x89,0x99,0x99,0x98,
0x89,0x99,0x8c,0xcc,0x88,0x99,0x99,0x99,
0x89,0x99,0x9c,0x8c,0xc9,0x99,0x98,0x88,
0x88,0x89,0x99,0x99,0x99,0x99,0x98,0x98,
// 1: 2:1
0x89,0x88,0x88,0x98,0x88,0x89,0x98,0x98,
0x99,0x98,0x88,0x98,0x98,0x88,0x88,0x88,
0x98,0x98,0x98,0x99,0x98,0x89,0x88,0x89,
0x89,0x88,0x89,0x89,0x99,0x89,0x89,0x88,
0x89,0x99,0x89,0x88,0x89,0x99,0x99,0x89,
0x99,0x99,0x98,0x88,0x89,0x99,0x88,0x89,
0x88,0x99,0x89,0x88,0x98,0x89,0x89,0x98,
0x88,0x88,0x89,0x88,0x88,0x89,0x88,0x98,
0x88,0x88,0x89,0x98,0x88,0x88,0x99,0x88,
0x89,0x88,0x98,0x88,0x98,0x98,0x89,0x98,
0x89,0x88,0x88,0x98,0x88,0x89,0x88,0x88,
0x89,0x98,0x99,0x98,0x98,0x99,0x89,0x99,
0x98,0x99,0x88,0x98,0x98,0x98,0x98,0x98,
0x89,0x99,0x99,0x88,0x88,0x88,0x98,0x99,
0x89,0x89,0x99,0x98,0x98,0x98,0x98,0x88,
0x88,0x88,0x98,0x88,0x98,0x99,0x98,0x98,
// 2: 2:236,1:437
0x99,0x88,0x88,0x88,0x88,0x89,0x99,0x98,
0x98,0x88,0x88,0x98,0x98,0x88,0x88,0x89,
0x88,0x88,0x99,0x99,0x99,0x88,0x89,0x89,
0x88,0x88,0x89,0x99,0x98,0x88,0x89,0x88,
0x88,0x88,0x98,0x99,0x89,0x88,0x88,0x99,
0x88,0x88,0x88,0x98,0x88,0x88,0x88,0x88,
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x98,
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
0x88,0x88,0x88,0x88,0x88,0x88,0x89,0x88,
0x89,0x88,0x88,0x88,0x88,0x88,0x98,0x99,
0x88,0x99,0x98,0x8c,0x89,0x99,0x99,0x98,
0x89,0x99,0x98,0xcc,0x89,0x99,0x99,0x99,
0x89,0x99,0x8c,0xcc,0x88,0x99,0x99,0x98,
0x89,0x99,0x9c,0x8c,0xc9,0x99,0x99,0x98,
0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,
// 3: 2:236
0x99,0x88,0x98,0x98,0x98,0x89,0x99,0x98,
0x98,0x98,0x88,0x99,0x98,0x88,0x88,0x89,
0x88,0x88,0x99,0x99,0x88,0x99,0x89,0x89,
0x89,0x88,0x89,0x88,0x99,0x99,0x99,0x88,
0x99,0x99,0x88,0x88,0x89,0x99,0x98,0x99,
0x89,0x98,0x88,0x88,0x99,0x88,0x99,0x88,
0x88,0x98,0x89,0x89,0x98,0x99,0x99,0x98,
0x88,0x88,0x89,0x88,0x88,0x88,0x98,0x88,
0x88,0x88,0x88,0x88,0x98,0x88,0x99,0x88,
0x89,0x88,0x98,0x98,0x98,0x99,0x89,0x88,
0x89,0x88,0x98,0x98,0x88,0x89,0x98,0x99,
0x88,0x98,0x99,0x99,0x99,0x99,0x99,0x98,
0x88,0x99,0x88,0x88,0x88,0x98,0x88,0x99,
0x89,0x99,0x99,0x98,0x98,0x88,0x98,0x98,
0x89,0x91,0x99,0x11,0x99,0x98,0x99,0x98,
0x99,0x99,0x99,0x91,0x11,0x19,0x99,0x99,
// 4: 2:2
0x11,0x19,0x99,0x99,0x99,0x99,0x99,0x11,
0x11,0x99,0x91,0x99,0x91,0x11,0x19,0x99,
0x11,0x11,0x19,0x91,0x11,0x11,0x19,0x11,
0x11,0x11,0x11,0x91,0x11,0x11,0x19,0x11,
0x99,0x99,0x99,0x99,0x11,0x11,0x19,0x99,
0x11,0x11,0x11,0x19,0x11,0x11,0x91,0x99,
0x11,0x11,0x11,0x99,0x11,0x11,0x91,0x11,
0x99,0x99,0x91,0x11,0x19,0x99,0x19,0x99,
0x91,0x19,0x11,0x11,0x19,0x19,0x91,0x19,
0x11,0x91,0x99,0x99,0x99,0x91,0x11,0x91,
0x11,0x11,0x11,0x99,0x11,0x11,0x19,0x91,
0x11,0x99,0x99,0x91,0x11,0x11,0x11,0x99,
0x11,0x91,0x19,0x99,0x99,0x99,0x99,0x11,
0x11,0x11,0x19,0x99,0x11,0x11,0x19,0x99,
0x11,0x91,0x19,0x99,0x91,0x11,0x19,0x91,
0x11,0x11,0x99,0x11,0x11,0x11,0x91,0x11,
// 5: 2:240
0x98,0x88,0x98,0x98,0x98,0x98,0x89,0x88,
0x99,0x99,0x98,0x99,0x88,0x88,0x88,0x89,
0x19,0x91,0x19,0x98,0x88,0x98,0x89,0x88,
0x11,0x11,0x98,0x99,0x99,0x89,0x99,0x88,
0x11,0x11,0x19,0x98,0x89,0x99,0x88,0x99,
0x19,0x19,0x11,0x99,0x99,0x88,0x98,0x88,
0x11,0x11,0x99,0x99,0x88,0x98,0x99,0x98,
0x11,0x99,0x11,0x11,0x98,0x88,0x98,0x88,
0x11,0x19,0x11,0x11,0x98,0x88,0x99,0x88,
0x11,0x11,0x19,0x99,0x99,0x98,0x88,0x88,
0x99,0x99,0x99,0x11,0x91,0x11,0x18,0x98,
0x11,0x91,0x11,0x91,0x11,0x19,0x89,0x98,
0x99,0x99,0x99,0x91,0x11,0x11,0x98,0x98,
0x11,0x11,0x19,0x11,0x11,0x11,0x18,0x98,
0x11,0x11,0x19,0x11,0x99,0x99,0x88,0x88,
0x99,0x99,0x99,0x91,0x11,0x19,0x99,0x98,
// 6: 2:1,2:23
0x89,0x88,0x88,0x98,0x88,0x89,0x98,0x88,
0x99,0x98,0x88,0x98,0x98,0x88,0xc9,0x99,
0x98,0x98,0x98,0x99,0x98,0x89,0x91,0x99,
0x89,0x88,0x89,0x89,0x99,0x88,0x99,0x19,
0x89,0x99,0x89,0x88,0x89,0x9c,0x99,0x91,
0x99,0x99,0x98,0x88,0x89,0x9c,0x99,0x91,
0x88,0x99,0x89,0x88,0x98,0x88,0xc9,0x99,
0x88,0x88,0x89,0x88,0x88,0x89,0x9c,0x9c,
0x88,0x88,0x89,0x98,0xcc,0xc9,0x99,0xc8,
0x89,0x88,0x98,0x89,0x19,0x99,0x19,0x9c,
0x89,0x88,0x88,0x91,0x9c,0xc9,0x99,0x1c,
0x89,0x98,0x99,0x9c,0xcc,0x89,0x99,0x1c,
0x98,0x99,0xc1,0xcc,0x88,0x89,0x99,0x1c,
0x89,0x9c,0x19,0xc8,0x88,0x89,0x99,0x9c,
0x89,0x8c,0x1c,0x88,0x89,0x89,0x99,0x9c,
0x88,0xc9,0x9c,0x89,0x98,0x89,0x99,0x9c,
// 7: 2:1,2:24
0x88,0x88,0x88,0x98,0x88,0x89,0x98,0x98,
0x99,0xc8,0x88,0x98,0x98,0x88,0x88,0x88,
0x99,0x98,0x98,0x99,0x98,0x89,0x88,0x89,
0x19,0xc8,0x89,0x89,0x99,0x89,0x89,0x88,
0xc8,0xcc,0x89,0x88,0x89,0x99,0x99,0x89,
0x89,0x9c,0x88,0x88,0x89,0x99,0x88,0x89,
0x89,0xc8,0x89,0x88,0x98,0x89,0x89,0x98,
0x89,0x88,0x89,0x88,0x88,0x89,0x88,0x98,
0x89,0x88,0x8c,0x98,0x88,0x88,0x99,0x88,
0x89,0x88,0x88,0x8c,0x98,0x98,0x89,0x98,
0x89,0x88,0x88,0xcc,0xc8,0x89,0x88,0x88,
0x89,0x88,0x88,0xc9,0x9c,0x99,0x89,0x99,
0x89,0x88,0x88,0xc9,0x99,0xc8,0x98,0x98,
0x89,0x88,0x88,0x8c,0x99,0x9c,0x98,0x99,
0x89,0x88,0x88,0x88,0xc9,0x9c,0x88,0x88,
0x89,0x88,0x89,0x89,0x8c,0x19,0x98,0x98,
// 8: 2:1,2:31
0x89,0xc9,0x98,0x99,0x99,0x18,0x99,0x9c,
0x9c,0x99,0x98,0x99,0x89,0x91,0x89,0x9c,
0x9c,0x19,0x1c,0x89,0x99,0x99,0x81,0x9c,
0x89,0x19,0x91,0x98,0x99,0x99,0x88,0x88,
0x89,0x91,0x99,0x19,0x89,0x99,0x88,0x99,
0x99,0x99,0x99,0x91,0x19,0x88,0x99,0x99,
0x89,0xcc,0xc9,0x19,0x91,0x19,0x98,0x99,
0x8c,0xcc,0x19,0x99,0x99,0x91,0x19,0x11,
0x8c,0xcc,0x9c,0x99,0x99,0x99,0x99,0x99,
0x89,0x89,0x9c,0x91,0xc9,0xc9,0x9c,0xcc,
0x89,0x8c,0xcc,0x99,0xc9,0xcc,0x9c,0x8c,
0x89,0x98,0xc8,0xcc,0xcc,0xcc,0x19,0xc9,
0x98,0x99,0x88,0x9c,0x91,0x9c,0x99,0xcc,
0x89,0x99,0x99,0x8c,0x91,0xcc,0x9c,0xc9,
0x89,0x89,0x99,0x98,0x89,0x88,0xc8,0x19,
0x88,0x88,0x98,0x88,0x98,0x8c,0x8c,0x99,
// 9: 2:1,2:32
0x89,0x88,0x99,0x89,0x9c,0x99,0x8c,0x88,
0x8c,0x81,0x99,0x88,0x99,0x99,0x88,0x88,
0x89,0x18,0x99,0x99,0x99,0x19,0x88,0x88,
0x88,0x99,0x99,0x99,0x91,0x99,0x88,0x88,
0x89,0x99,0x99,0x89,0x19,0x9c,0x8c,0x88,
0x99,0x99,0x88,0x11,0x99,0x8c,0xc8,0x88,
0x88,0x89,0x11,0x99,0x98,0x88,0x98,0x88,
0x19,0x19,0x99,0xcc,0x9c,0x9c,0x98,0x88,
0x99,0x9c,0xcc,0x8c,0x9c,0x99,0x88,0x88,
0xcc,0x88,0x88,0xc8,0x99,0x98,0x88,0x88,
0x98,0xc9,0xcc,0x98,0xc9,0x98,0x88,0x88,
0x9c,0x99,0x99,0x9c,0x88,0x88,0x89,0x99,
0x9c,0x99,0x9c,0x9c,0x88,0x88,0x88,0x98,
0xc8,0x99,0xc8,0x9c,0x88,0x88,0x98,0x99,
0x98,0x99,0xc8,0x88,0x88,0x98,0x98,0x88,
0x9c,0xcc,0x88,0x88,0x98,0x99,0x98,0x98,
// a: 2:228,1:437
0x91,0x11,0x88,0x88,0x88,0x99,0x99,0x19,
0x98,0x88,0x88,0x98,0x98,0x88,0x18,0x89,
0x88,0x88,0x99,0x99,0x99,0x88,0x89,0x89,
0x88,0x88,0x89,0x99,0x98,0x88,0x89,0x88,
0x88,0x88,0x98,0x99,0x89,0x88,0x88,0x99,
0x88,0x88,0x88,0x98,0x88,0x88,0x88,0x88,
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x98,
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
0x88,0x88,0x88,0x88,0x88,0x88,0x89,0x88,
0x89,0x88,0x88,0x88,0x88,0x88,0x98,0x99,
0x88,0x99,0x98,0x8c,0x89,0x99,0x99,0x98,
0x89,0x99,0x98,0xcc,0x89,0x99,0x99,0x99,
0x89,0x99,0x8c,0xcc,0x88,0x99,0x99,0x98,
0x89,0x99,0x9c,0x8c,0xc9,0x99,0x98,0x88,
0x88,0x89,0x99,0x99,0x99,0x99,0x99,0x98,
// b: 2:228
0x91,0x11,0x91,0x99,0x99,0x99,0x99,0x19,
0x98,0x98,0x89,0x11,0x11,0x11,0x18,0x89,
0x88,0x88,0x99,0x99,0x99,0x99,0x89,0x89,
0x89,0x88,0x89,0x88,0x99,0x89,0x99,0x88,
0x99,0x99,0x88,0x88,0x89,0x99,0x98,0x99,
0x89,0x98,0x88,0x88,0x99,0x88,0x99,0x88,
0x88,0x99,0x89,0x89,0x98,0x99,0x99,0x98,
0x88,0x88,0x89,0x88,0x88,0x88,0x98,0x88,
0x88,0x88,0x88,0x88,0x98,0x88,0x99,0x88,
0x89,0x88,0x98,0x98,0x98,0x99,0x89,0x88,
0x89,0x88,0x98,0x98,0x88,0x89,0x98,0x99,
0x88,0x98,0x99,0x99,0x99,0x99,0x99,0x98,
0x88,0x99,0x88,0x88,0x88,0x98,0x88,0x99,
0x89,0x99,0x99,0x98,0x98,0x88,0x98,0x98,
0x89,0x99,0x98,0x98,0x99,0x98,0x98,0x88,
0x88,0x88,0x88,0x98,0x88,0x99,0x99,0x98,
// c: 2:237
0x89,0x11,0x91,0x99,0x99,0x99,0x99,0x11,
0x88,0x88,0x89,0x11,0x11,0x11,0x19,0x99,
0x88,0x88,0x98,0x99,0x99,0x99,0x99,0x11,
0x89,0x88,0x88,0x11,0x11,0x11,0x19,0x11,
0x99,0x99,0x88,0x99,0x99,0x99,0x99,0x11,
0x89,0x98,0x88,0x91,0x11,0x19,0x11,0x11,
0x98,0x98,0x99,0x89,0x91,0x99,0x99,0x11,
0x88,0x88,0x89,0x88,0x81,0x11,0x11,0x99,
0x88,0x88,0x88,0x88,0x89,0x11,0x11,0x91,
0x99,0x88,0x88,0x98,0x98,0x88,0x89,0x91,
0x99,0x88,0x98,0x98,0x88,0x89,0x88,0x91,
0x88,0x98,0x99,0x99,0x99,0x99,0x99,0x91,
0x88,0x99,0x88,0x88,0x88,0x98,0x89,0x11,
0x89,0x99,0x98,0x98,0x98,0x88,0x99,0x99,
0x89,0x89,0x98,0x98,0x99,0x98,0x98,0x91,
0x88,0x88,0x98,0x98,0x88,0x99,0x99,0x88,
// d: 2:1,2:121
0x89,0x88,0x88,0x98,0x88,0x89,0x98,0x98,
0x99,0x98,0x88,0x98,0x98,0x88,0x88,0x88,
0x98,0x98,0x98,0x99,0x98,0x89,0x88,0x89,
0x89,0x88,0x89,0x89,0x99,0x89,0x89,0x88,
0x89,0x99,0x89,0x88,0x89,0x99,0x99,0x89,
0x99,0x99,0x98,0x88,0x89,0x99,0x88,0x89,
0x88,0x99,0x89,0x88,0x98,0x89,0x89,0x98,
0x88,0x88,0x89,0x88,0x88,0x89,0x88,0x98,
0x88,0x88,0x89,0x98,0x88,0x88,0x99,0x88,
0x89,0x88,0x98,0x88,0x98,0x98,0x89,0x98,
0x89,0x88,0x88,0x98,0x88,0x89,0x88,0x88,
0x89,0x98,0x99,0x98,0x98,0x99,0x89,0x99,
0x98,0x99,0x88,0x98,0x98,0x98,0x98,0x98,
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
0x89,0x99,0x99,0x99,0x99,0x99,0x99,0x99,
0x89,0x99,0x99,0x99,0x99,0x99,0x99,0x99,
// e: 2:1,1:437,2:122
0x89,0x88,0x88,0x88,0x88,0x89,0x98,0x98,
0x99,0x88,0x88,0x98,0x98,0x88,0x88,0x88,
0x98,0x88,0x99,0x99,0x99,0x88,0x88,0x89,
0x88,0x88,0x89,0x99,0x98,0x88,0x89,0x88,
0x88,0x88,0x98,0x99,0x89,0x88,0x88,0x89,
0x88,0x88,0x88,0x98,0x88,0x88,0x88,0x89,
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x98,
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x98,
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
0x88,0x88,0x88,0x88,0x88,0x88,0x89,0x98,
0x89,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
0x89,0x99,0x98,0x8c,0x89,0x99,0x99,0x99,
0x99,0x99,0x98,0xcc,0x89,0x99,0x99,0x98,
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x89,
0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x98,
0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x98,
// f: 2:236,2:129
0x9c,0x99,0x99,0x99,0x99,0x99,0x99,0x99,
0x9c,0x99,0x99,0x99,0x99,0x99,0x99,0x99,
0x88,0x88,0x9c,0x99,0x88,0x99,0x89,0x89,
0x89,0x88,0x8c,0xc8,0x99,0x99,0x99,0x88,
0x9c,0x9c,0xc9,0xcc,0xcc,0xcc,0xcc,0xcc,
0x8c,0xcc,0xc9,0xc9,0x99,0x99,0xc9,0xc9,
0x8c,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,
0x8c,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,
0x8c,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,
0x8c,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,
0x8c,0xcc,0x88,0x88,0x88,0x88,0x88,0x88,
0x88,0xcc,0xc8,0x88,0x88,0x88,0x88,0x88,
0x88,0x9c,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,
0x89,0x9c,0x88,0x88,0x88,0x88,0x88,0x88,
0x8c,0xc8,0x89,0x11,0x99,0x98,0x99,0x98,
0x99,0x99,0x99,0x91,0x11,0x19,0x99,0x99,
// 10: 2:236,2:130
0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x98,
0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,
0x88,0x88,0x99,0x99,0x88,0xcc,0x89,0x89,
0x89,0x88,0x89,0x88,0x99,0xcc,0x99,0x88,
0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0x99,0xc9,
0x9c,0x99,0x99,0xc9,0x99,0xcc,0xc9,0x98,
0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0xc8,
0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0xc8,
0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0xc8,
0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0xc8,
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
0x88,0x88,0x88,0x88,0x88,0x88,0xcc,0x88,
0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0xc8,
0x88,0x88,0x88,0x88,0x88,0x88,0x8c,0xc8,
0x89,0x91,0x99,0x11,0x99,0x98,0x9c,0xc8,
0x99,0x99,0x99,0x91,0x11,0x19,0x99,0x99,
       };
//TODO: make this actually work.
        ptr = tiles[id];
        ");
        return ptr;
    }
}

Notice it has 3 pieces to it:

  • The map itself by name getGardenPath
  • The map data (collisions and special tile data) gardenPathData (will probably rename)
  • The tiles getTile

Just an initial run at this, I will need to fix a lot of the data types and conversions and everything. But this should be, by my own estimations of course, enough to get started with poking at the line filler for tiles :eyes: I hope…

3 Likes

We’ve got tiles!! Sort of :smiley:

coming along now:
image

5 Likes

We have MAP!

As you can tell in the bottom the fps is not optimized :slight_smile: but that can be fixed up eventually. But we have TILES AND SPRITES! WOO!

Coming up next:

  • Camera coordinates to be able to move the map/camera around.
  • Optimizations!!
  • Testing out map switching :wink: should already “just work”
  • I should not forget to document. The API and expected methods will be important to have documented.

Do note, this could be used now to make a huge variety of different games as is! (though with less than ideal performance). So we are getting there! I am so excited with this :smiley:

6 Likes

This is a huge step forwards. Good work!

1 Like

Yeah … this is really coming along nicely.

1 Like