|
Post by alexmega on Nov 2, 2018 11:48:15 GMT -5
Good Morning!. I'd like some help. I would like to know how do I clone the same image using the same addsprite and movesprite but for different objects. I know this technique is used in espace invaders and I would like an example that I can. because with this I can add more objects relieving the amount of sprites on the screen., sample_clone.sbs (441 B) thank you that can solve!
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Nov 3, 2018 5:51:00 GMT -5
Dim Invaders(54) As Integer ' 55 invaders For i = 0 to 54 Invaders(i) = AddSprite(4,4) PropSprite Invaders(i),100,0 Next
If you want control over every invader, you'll need individual sprites. Remember, though, you can only have 320 pixels per scanline before sprite data is not drawn for that line.
You can only have 80 sprites loaded/defined at once.
Another way is to just draw them directly to one plane, and shift the plane and keep track of the coordinates / hit boxes.
|
|
|
Post by alexmega on Nov 4, 2018 19:51:16 GMT -5
Thanks!
taking advantage of the help. so I'm having problems in my ship game when I'm going to put the enemy events at each exchange of them I use the freesprite in the first situation to eliminate the sprites of the old enemies to be able to swap the second via loadtiles. the problem is that when running the second freesprites to clean the same does not add up and when I do the other input the screen hangs. What am I doing wrong?
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Nov 12, 2018 10:44:46 GMT -5
Not a direct answer. But, I never use freesprite. I decide how many sprites I want to manage and then just use (and re-use) those. "Destroyed" invaders can be positioned off screen and/or have their sprite index set to some blank tiles.
|
|
|
Post by alexmega on Nov 12, 2018 19:36:35 GMT -5
Okay, that's what I wanted to know. thank you
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Nov 13, 2018 11:33:56 GMT -5
Why are you people afraid to use freesprite?
|
|
|
Post by tiberiyltim on Nov 15, 2018 6:21:56 GMT -5
BEX have bugs with freesprite on real hardware system.
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Nov 15, 2018 14:13:59 GMT -5
BEX have bugs with freesprite on real hardware system. Those bugs have been addressed and explained how to avoid them. It also doesn’t have a “bug on hardware”, it’s a bug when freeing the very first sprite you create, which will show in emulation. (Hint, don’t free the very first sprite with FreeSprite, use FreeAllSprites).
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Nov 15, 2018 15:37:37 GMT -5
Yeah. I heard about BEX and FreeSprite. But, the main reason is my mind doesn't play well with adding and deleting things at runtime. I like to know exactly how many objects I have to worry about at all times. But, I understand that's just my style.
|
|