|
Post by alexmega on Aug 30, 2018 17:11:14 GMT -5
good evening. I have a question, I want to implement this code that I observed in the forum in my project, the problem is that in bex it works but in the second basic, no. I do not know how to adapt. if anyone gets it will be of great help. tiro lateralrar.rar (7.39 KB)
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Sept 1, 2018 17:45:43 GMT -5
Not a direct answer.
I don't use dataptr& or any xxxxptr commands very often. Mostly because my style is to allocate my sprite resources at the start of the game and not change, swap, add, delete things. If it were me I'd create a set amount of sprites for players and bullets.
|
|
|
Post by alexmega on Sept 1, 2018 22:07:28 GMT -5
so for example if there are three sequences of fire, then do I have to make a variable for each? right?
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Sept 6, 2018 8:39:41 GMT -5
so for example if there are three sequences of fire, then do I have to make a variable for each? right? Basically I plan out how many players, enemies, bonus items and projectiles I want to ever deal with in the game. Say, 2 player sprites. 5 enemies on screen. 2 power ups / bonus items. 16 projectiles. I then initialize the sprites, load the tiles and default values for these objects. Within the main loop I manage when projectiles get recycled. What set of tiles a sprite is animating on etc.. No allocating / de-allocating sprites. No unexpected slowdown since you know exactly what the maximum number of objects can be on-screen.
|
|
|
Post by alexmega on Sept 7, 2018 22:55:41 GMT -5
so for example if there are three sequences of fire, then do I have to make a variable for each? right? Basically I plan out how many players, enemies, bonus items and projectiles I want to ever deal with in the game. Say, 2 player sprites. 5 enemies on screen. 2 power ups / bonus items. 16 projectiles. I then initialize the sprites, load the tiles and default values for these objects. Within the main loop I manage when projectiles get recycled. What set of tiles a sprite is animating on etc.. No allocating / de-allocating sprites. No unexpected slowdown since you know exactly what the maximum number of objects can be on-screen. Good evening, you would have some sample sample demonstrating this, could even be higher than mine?
|
|