Mini Map Help

JeffreyDriver

  • Posts: 2262
I have a mini map that shows various types of actors, but I cannot figure out how to do the same for tiles.

I know that the general idea is to loop through all the possible locations and then draw blocks on the screen accordingly. I'm not even sure where to begin. I know this question has been asked before, but I haven't seen anything which helps.

Thanks.

JeffreyDriver

  • Posts: 2262
Here's what I've got so far, and it does work, but in this case, it requires each row to be dealt with manually. I can't figure out how to cycle through the rows as well. I'd rather not do it manually as there are 300 rows.

squeeb

  • Posts: 1617
http://community.stencyl.com/index.php/topic,35612.0.html
There is a loop style block.. i havent used it yet... may be what want..
vvv description of block vvv
Works just like the built-in loop block, but works over a 'grid'. This allows you to easily create grid-based structures, or loop over sections of the scene with the Tile API.



JeffreyDriver

  • Posts: 2262
Posting my code to help others.

Although it does work, due to the number of tiles (my scene is huge, 300 x 300 tiles) there's a lot of lag when viewing the map. Not a huge problem for gameplay as the game is paused when the map is up, but I'm still going to have to switch from using drawing blocks to using the Image API.

It's drawing around 45,000  shapes!

squeeb

  • Posts: 1617
Ahh.. i see what youve done.. sweet... it can be optimized :)

CmdrWhitey13

  • Posts: 505

Although it does work, due to the number of tiles (my scene is huge, 300 x 300 tiles) there's a lot of lag when viewing the map. Not a huge problem for gameplay as the game is paused when the map is up, but I'm still going to have to switch from using drawing blocks to using the Image API.

It's drawing around 45,000  shapes!

Limit Use of Custom Drawing
The Drawing blocks under the Drawing category in Design Mode allow you to draw custom shapes on screen.

Using them takes up a lot of processing power, though, so take into consideration how many custom shapes you're drawing on screen at any given time. Consider pre-rendering your effects instead.

http://www.stencyl.com/help/view/optimize-game-performance/

Ahh.. i see what youve done.. sweet... it can be optimized :)

Setting Pixels

When setting many pixels at a time, use the batch draw block (placed right above the set pixel block). This informs the system not to push an image's updates to all its instances until you've finished your work.



http://www.stencyl.com/help/view/image-api

Optimize would be better if you can make a minimap image and draw pixels for tiles. Batch draw on imge may help if you go this route.  Shapes not so well on performance.

Hope this helps.

JeffreyDriver

  • Posts: 2262
Thanks. Yeah, I will have to swap out the drawing code for the image API.

squeeb

  • Posts: 1617
Rimrook is working on one also.. more metroid style.... team up?