Log In  
Follow
Mellogy
[ :: Read More :: ]

Cart #picos_farm-0 | 2021-01-04 | Code ▽ | Embed ▽ | No License
1

A game made in roughly 3 days for the ToyBoxJam 2020! Plant some crops and stay out of debt. See how many days you can last.

This doesn't quite have all the stuff that I wanted to put in it, but now that the deadline is extended I'll probably keep playing with the concept :)

It definitely needs a good chunk of optimization, but I still think it's a fun little toy.

P#86120 2021-01-04 02:36

[ :: Read More :: ]

Cart #sasnagoza-0 | 2020-12-30 | Code ▽ | Embed ▽ | No License
2

Arrow keys to move around, X to place a grass tile. Just a quick and dirty implementation of tile bitmasking.

Basic process is:

  • Create table same width/height as map, store what kind of tile is here (empty,grass,water,etc)
  • When you hit the X key, assign the corresponding index in the table to 1
  • Run a function to update the map accordingly
  • Show map and cursor

The autotile function checks the cardinal directions for neighboring tiles of the same type using the table, then returns a value 0-15 depending on what came back. Then we pull from another table filled with sprite indexes to figure out what should go on the map.

I used this article to figure out the best way to go about this: https://gamedevelopment.tutsplus.com/tutorials/how-to-use-tile-bitmasking-to-auto-tile-your-level-layouts--cms-25673

This current implementation is quite token heavy and isn't the cleanest thing in the world, but it's a good start I think!

P#85915 2020-12-30 03:44

[ :: Read More :: ]

Cart #nineslice-0 | 2019-06-13 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
2

A quick little function to draw 9-slice boxes. Has modes for stretched or repeated sprites along the borders, and an optional background color. A little heavy for general use at ~444 tokens, and could probably be optimized further.

Use:

nineslice(x origin,y origin,width in px,height in px,
          sprite index for upper left corner, stretched mode (true/false), 
          background color)
P#65178 2019-06-13 16:16