LoginLogin

Making a Shoot 'Em Up Game, but still with some doubts.

Root / Programming Questions / [.]

the_squat1115Created:
And the way to fix it is to spawn the enemies only once, or you'll run out of sprites.

And the way to fix it is to spawn the enemies only once, or you'll run out of sprites.
See the ASCII map data and if you see the "A" string, thats where the enemy needs to spawn. ALSO, there is only one "A" string, so thats the only enemy. AND the "A" is the enemy.

I don't understand what you're trying to say.

I don't understand what you're trying to say.
I mean, I put a tile check on the MAPRENDER loop, so it checks if there is any "A" string, which means it detected an enemy, so, instead of reading the "A" string as a tile, it tells the ASCII reader to stop reading the map and letting the tile-check to do his work, the enemy generating, but, when it finishes spawning the enemy, it simply ignores the position of the "A" string, so it puts the enemy instead of centering it on the position that the ASCII map defined, it just puts the sprite on its default position. Thats my problem.

That's because you need to use SPOFS Just use the map tile coordinates you would use for BGPUT multiplied by 16.

That's because you need to use SPOFS Just use the map tile coordinates you would use for BGPUT multiplied by 16.
Thanks But how do I determine the coords. used by BGPUT?

That's because you need to use SPOFS Just use the map tile coordinates you would use for BGPUT multiplied by 16.
Thanks But how do I determine the coords. used by BGPUT?
Like I said, it's just the ones you used in BGPUT, or in other words the FOR loop variables.

That's because you need to use SPOFS Just use the map tile coordinates you would use for BGPUT multiplied by 16.
Thanks But how do I determine the coords. used by BGPUT?
Like I said, it's just the ones you used in BGPUT, or in other words the FOR loop variables.
Oh, thanks, so, the variables I used in the FOR loops are the BGTABLE and MAP$ just multiplied by 16? Got it. EDIT: I've multiplied those MAP$ and BGTABLE variables by 16, but now, SmileBASIC spams with this:
Syntax error in 0:69(SPOFS:1)
And when I put the SPOFS J#,I#, comes with an Out of range error:
Out of range in 0:69(SPOFS:1)
Actually, I don't know if this is normal, or a bug from SB, but, if it's not, there may be a solution.

No, it's not those. It's the variables that the FOR loop changes, I and J.

No, it's not those. It's the variables that the FOR loop changes, I and J.
And how the heck do I determine them?

They are already determined because of the FOR loop. That's how FOR loops work. Oh also, you're still spawning the enemy too much. You should only spawn it on one frame, or at the exact time that it should come on screen.

They are already determined because of the FOR loop. That's how FOR loops work. Oh also, you're still spawning the enemy too much. You should only spawn it on one frame, or at the exact time that it should come on screen.
So, I just need to put SPOFS I#,I#?

They are already determined because of the FOR loop. That's how FOR loops work. Oh also, you're still spawning the enemy too much. You should only spawn it on one frame, or at the exact time that it should come on screen.
So, I just need to put SPOFS I#,I#?
nonono 1. You used I# twice 2. you need to multiply them by 16 to match the tile coordinates

They are already determined because of the FOR loop. That's how FOR loops work. Oh also, you're still spawning the enemy too much. You should only spawn it on one frame, or at the exact time that it should come on screen.
So, I just need to put SPOFS I#,I#?
nonono 1. You used I# twice 2. you need to multiply them by 16 to match the tile coordinates
Thanks! I had finally managed to do that, just that I didn't know how do I certainly position correctly the sprite, but there is another problem I have (I don't want to push you, I could still figure it on my own, but sometimes I couldn't figure it without help), is that when I make a map too large that it gets too off-screen, I get this error: Out of range in 0:79(BGPUT:3) I had even made some little changes on the code, but still I get this error.

BGSCREEN layer, map width, map height will make the map have the desired size.

BGSCREEN layer, map width, map height will make the map have the desired size.
I did that...

How did you do it? If you just do it and give it a map bigger it will obviously error. Are you even giving it the size of what you read or you're just giving it an arbitrary value and saying it's SB's fault?

How did you do it?
I'll send you a screenshot And the height is the same as BGSCREEN (count them)

ugh my 3DS can't load your screenshots

ugh my 3DS can't load your screenshots
Try reloading the page again