Log In  

Cart #boxmoover-0 | 2023-12-03 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
3

Boxmoover

A cute little game about a cow helping you move.

Learned things

We loaded levels via reading each tile of the map, getting which sprite it was, and creating an entity based on that.
While the math on loading levels via the map was a little odd at first.
It lead to a really easy ways to create levels via the pico8 level editor.
The downside is that it makes it hard to reload the lvls with the same code.
Because levels loaded at when levels change instead of at the start of the game therefore the map data would change until the game was restarted.
Not being able to read the map data after a level change meant that we couldn't reload previous levels.
What would of been better would have been to save the initial map state in _init.
Then, create levels based on that information.
Essentially only ever using spr() and not map()

This is our first time using the map editor in Pico-8.
It's fun but a little limited.
When cutting a set of sprites in the map editor you have to use the stamp tool to paste.
The pan tool will tell you what the x and y is of the upper left corner.
We want to know more shortcuts and tricks in the map editor.

To anyone reading

Thanks for reading and hopefully playing :)
If you have any suggestions feel free to let me know. Especially map editor tricks and tips!

P#138172 2023-12-03 06:59 ( Edited 2023-12-03 07:03)

1

You can restore the map to it's original state by calling reload(), this way there's no problem modifying the map during gameplay, and still implement level select.
You can also limit the accessible levels by saving the current max reached with cartdata, dset and dget.

If you intend to add harder levels, it would be nice to implement undo. This can be done by saving every played move into an array (beware that moving right is not the same as pushing right).
Undoing is just playing the last move backwards and removing it from the moves array.
For cosmetics, you can flip the cow sprite when moving left.
Moooo

P#138175 2023-12-03 10:18

Thanks for the suggestions and tips on the map :D! reload() seems really useful

Could you explain what you mean by "limit the accessible levels by saving the current max reached with cartdata, dset, and dget"? I maybe don't understand what you mean by "limit accessible levels"

P#138187 2023-12-03 18:44 ( Edited 2023-12-03 18:46)
1

If you make a level select, you might choose to limit the levels to only the latest unfinished level + all previous ones, or maybe just highlight which levels were completed. It would be nice to save that data so players don't have to do it all again on reload.

P#138194 2023-12-03 20:30
1

@wesleyparriott , @Verb understood what I meant, When implementing a level select, it's nice not to give access to everything to the player at once as it can make the game look too small or too daunting, and also make things look pointless.
To give a better sense of accomplishment, access to new levels can be the reward for solving levels. If there's a lot of levels, it becomes important to remember what has been solved between gaming sessions.
The simplest way to accomplish that is simply to remember the highest level solved, and giving access to every level up to that number+1.
Verb is suggesting something a bit more advanced : keep track of what level has been solved. This solution has the advantage that you can skip levels you are stuck on, and easily return to them later thanks to their "unsolved" status.
Note that both strategies of rewarding wins with unlock and keep track of each solves can be accomplished simultaneously with a buffer :
At start, you can play any level from 1 to say 5.
At all times, levels available are from 1 up to number of levels solved+5. This way you have a limited number of skips that you can recover later by solving skipped levels.

On the Pico-8 side of things :
cartdata("wesleyparriott_boxmoover")
Tells pico-8 the name of the save storage your game will be using.
The convention is putting your name and game name in the string, to make sure not to step on the saves of other games. Nothing stops you from doing whatever, like having games sharing the same save storage and having unlocks coming from other games...

A storage contains 64 pico-8 numeric variables (the classic 16bits signed integer part and 16 bits fractional part)
Once the save storage has been selected, you can retrieve the value of a variable with value=dget(index), or set it with dset(index,value)

If a storage is used for the first time, it's initialized at 0 for every value.

Assuming we just solved level number current_level
my suggestion would be something like this :

   best=dget(0)
   if (current_level>best) dset(0,current_level)

And with Verb's suggestion

   dset(current_level,1)

If you have more than 63 levels in your game, you'll need to be less wasteful with the save space by using pokes to directly modify the 4 bytes of each variable. With the 256 bytes of cartdata (64 variables x 4 bytes), you could store up to 2048 solve flags.

About the level select, since everything is already in the map, you can simply use camera movement to go from one level shown to the other.

P#138196 2023-12-03 22:22 ( Edited 2023-12-03 22:33)
1

Thanks! I wasn't very familiar with how cartdata works and I'm excited to learn and experiment more with it.

Maybe I'll update the game with a proper level selector, an undo, and maybe even some harder levels.

The only thing is that I wanted this to be able to be beat in one session while a person was bored trying games out in splore. I really like small tight games and that's what I aspire to make. With helpful stuff like this I know I'll make something like that someday :)

P#138233 2023-12-04 18:52

[Please log in to post a comment]