I would like to build walls for a shoot'em'up and I know I can obtain the result with map.
What I do not understand is how to make the drawing dynamic.
For example I have the sprite 0 that contains my wall and I would like PICO-8 to draw walls on the side programmatically.
What would be the best approach to do so?
Thanks for your time and patience.
This is a tough question, not because it's hard to do, but because there are so many ways to do it that it's tough to know what would be best for your project.
The simplest way would probably be this.
for xx = 1 to 16 do spr( WallSprite, xx, 0 ) end
That'll put a wall across the top of the screen. (Unless I've made a typo somewhere, which is very likely.)
There are much more complicated answers depending on what you're trying to do.
Maybe you could describe your project a little more, then we could provide a more detailed suggestions.
An alternative way is to use a map, draw the wall tile into to map with mset(x,y,0) and render the map in _draw(). Might be a good ides to preserve 0 as "void" in that case and move the wall sprite to index 1. If you not only want to draw the wall, but do want collision checks, using a map might be better.
Thanks for your input, guys!
Sorry if my request was not that clear, I will try to explain better.
In my dreams it would be something similar (but waaaaaaaay uglier and simpler) to Xenon 2.
A vertical scroller with boundaries on the sides.
After scrolling for a bit a final monster, end :)
Here's a very simple and failed attempt, using apLundell's idea:
for x=0,-500,128 do
[Please log in to post a comment]