So I ran into another wall.
I was trying to get items to randomly appear on the playfield and then allow player0 to collide with them for either points, additional time, or something else like temporary speed increase.
I seemed to get the randomization working, where one item is on the screen while the others are not. I also seem to have it recognize if there is a collision but there is where the issue lies - when player0 and the virtual sprite collide, the virtual sprite doesn't stay there. It seems to stay there but if the player is over the coordinates when it disappears the benefit is received (as a test I have it as +500 to the score).
I have this in the main code:
if _sc3 >= 0 then gosub _POWERUPS bank4
to get to this:
bank 4 rem ***************************************************** temp1 = temp1 _POWERUPS q=q+1 if q=140 then goto _power_mod else return otherbank _power_mod p = rand&6 if p=1 then goto _skip_powerups1 if p=2 then goto _pup7 if p=3 then goto _pup8 if p=4 then goto _pup9 if p=5 then goto _pup10 if p=6 then goto _skip_powerups2 rem energy _pup7 player7x = (rand&123)+16 player7y = (rand&100)+40 goto _skip_powerups2 rem time _pup8 player8x = (rand&123)+16 player8y = (rand&100)+40 goto _skip_powerups2 rem money _pup9 player9x = (rand&123)+16 player9y = (rand&100)+40 goto _skip_powerups2 _1up goto _skip_powerups1 _pup10 goto _skip_powerups1 rem skip _skip_powerups2 if player0x <= player7x + 8 && player0x + 8 >= player7x && player7y + player7height >= player0y && player7y <= player0y + player0height then goto _energy if !collision(player0,player7) then return otherbank _energy score=score+500 _skip_powerups1 player7y=200 player8y=200 player9y=200 p=0:q=0 return otherbank
The only thing I can think of is that it is in a different bank and if maybe something isn't carrying over. I have a similar issue that happens with other virtual sprites where if the score goes over a certain number they appear but if the score dips below that threshold the virtual sprites disappear and collision detection doesn't seem to work. I didn't really think too much of that because I didn't plan on having the score fluctuate in a manner where that would be an issue.
I have written and rewritten code to see if I can get it to work and haven't found anything in the forums. Was wondering if this was something extremely obvious that I just seemed to miss...