Jump to content
  • entries
    469
  • comments
    324
  • views
    400,037

GOOMW!

Serguei2

271 views

I worked on my brawler game today.

Our good guy managed to beat down all his foes.

Now he is ready to go to the next room.


Now let's talk about the arrow: LOL

The arrow is made with sprites but some part of the sprites are missing.

blogentry-1196-0-99578500-1553485321_thumb.png

If I set the arrow x to 40, it shows without problems.

But I want to place the arrow higher on the screen, like most brawler games do most of the time.

Ok. That's all for today.


Good night everybody.

  • Like 1


1 Comment


Recommended Comments

Call SweepSprite() upon initialization so sprites are placed outside the screen boundry. Without that all the sprites at zero'd upon start, so the unused sprites are at position x=0,y=0.

Here's my code to place all sprites off screen:

void SweepSprites(void){
for (i=0;i!=32;i++){
sprites[i].y = 207;
}
updatesprites(0,64);
}

Further explanation. When sprite[?].y=208, it sets a flag sprite termination flag for the sprite for the rest of the array to not show up. So if you place a that number in sprite[3].y=208. Sprite 3 and up won't show up. if you're moving the sprite up and down in the area out of bound, it'll skip that number(C code I noticed skip this number when sprites move vertically).

I place my sprites I don't need at 207 so I don't trigger the sprite termination.

 

Share this comment


Link to comment
Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...