Mini Map Help

JeffreyDriver

  • Posts: 1865
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.
Current Projects:
Retro Redux Compilation (NEW).
Retro Redux (untitled) (NEW).
I always appreciate useful feedback. Thank you.
www.jeffreydriver.co.uk

JeffreyDriver

  • Posts: 1865
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.
Current Projects:
Retro Redux Compilation (NEW).
Retro Redux (untitled) (NEW).
I always appreciate useful feedback. Thank you.
www.jeffreydriver.co.uk

squeeb

  • Posts: 1418
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: 1865
Thanks squeeb! That did it.
Current Projects:
Retro Redux Compilation (NEW).
Retro Redux (untitled) (NEW).
I always appreciate useful feedback. Thank you.
www.jeffreydriver.co.uk


JeffreyDriver

  • Posts: 1865
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!
Current Projects:
Retro Redux Compilation (NEW).
Retro Redux (untitled) (NEW).
I always appreciate useful feedback. Thank you.
www.jeffreydriver.co.uk

squeeb

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

CmdrWhitey13

  • Posts: 488

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: 1865
Thanks. Yeah, I will have to swap out the drawing code for the image API.
Current Projects:
Retro Redux Compilation (NEW).
Retro Redux (untitled) (NEW).
I always appreciate useful feedback. Thank you.
www.jeffreydriver.co.uk

squeeb

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