Jump to content





GOOMW!

Posted by Serguei2, in Programming Colecovision, My brawler game 24 March 2019 · 66 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.
 
Attached Image
 
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.






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.

 

  • Report

April 2019

S M T W T F S
 123456
78910111213
14151617181920
21 222324252627
282930    

3 user(s) viewing

0 members, 3 guests, 0 anonymous users

Search My Blog

Latest Visitors