+Gemintronic Posted April 8, 2014 Share Posted April 8, 2014 I'm trying to design a game so that falling virtual sprites NEVER share the same horizontal space. I think I figured out the logic but it still flickers at the top and bottom portions of the screen.. ..any clues, fellas? msflicker.bas msflicker.bin Quote Link to comment Share on other sites More sharing options...
iesposta Posted April 8, 2014 Share Posted April 8, 2014 All I can pass along is what I have seen in the DPC+ Kernel, which is similar to the multisprite in a lot of ways. In DPC+, sprites have to have at least seven lines between them or they intelligently flicker. In DK Arcade 2600, you can see when the barrels appear new at the top, ALL the virtual sprites flicker a frame, (the barrel, the 2 hammers, any other on-screen barrels.) This was the first time I noticed that behaviour. One other thing that can cause them to start intelligently flickering is if they are close to off-screen sprites. Now DPC+ offscreen is not Y=0, I have been using Y=200 to move them offscreen. I don't know if the kernel you use works that way or not. Setting playerheights larger than displayed pixels can cause flicker, I think, if they become close. Maybe set playerheights to 0 when offscreen? Again, I'm only guessing here. 2 Quote Link to comment Share on other sites More sharing options...
+Gemintronic Posted April 9, 2014 Author Share Posted April 9, 2014 That's a big clue iesposta. Thanks! I set the playerxheight to 0 to effectively blank out the sprite without resorting to a line like this: player1: ........ end As long as they share the same virtual y the engine may be flickering them even when no need exists. I'll run some experiments to see if that's the case! 1 Quote Link to comment Share on other sites More sharing options...
bogax Posted April 9, 2014 Share Posted April 9, 2014 (edited) It isn't the normal flicker and it doesn't only do it for a height of 0 I'm guessing the sorting routine is getting confused some way if you set things up so you can step players1..5 you can see that they completely disappear. does it with the height set to 1 or 2 also. I haven't played with it enough to figure out what's going on, I don't know if it's position or overlap or what. also it doesn't seem to do it if at least one of the parked sprites has a height >2 I don't see anything in your code. you have a hole in your heart(s) Edited April 9, 2014 by bogax Quote Link to comment Share on other sites More sharing options...
RevEng Posted April 9, 2014 Share Posted April 9, 2014 you have a hole in your heart(s) I think we've all known that for years, but it seems uncalled-for to say it now. Ohhhh... you mean the heart in the game! Quote Link to comment Share on other sites More sharing options...
+Gemintronic Posted April 9, 2014 Author Share Posted April 9, 2014 I think I have it solved.. enough Still flickers at the bottom. msflicker2.bas msflicker2.bin When a sprite needs to clear off the screen it wasn't enough just to change the height to 0. I set each sprites off-screen position 10 pixels away vertically from any other sprite. player1y = 110 : player2y = 120 : player3y = 130 : player4y = 140 : player5y = 150 Normally I'd be afraid the sprites would warp and go funky with off screen positions like this but it didn't happen. Just try going off-screen vertically with the first sprite to see what I mean. The hole in the heart is supposed to represent the shine coming off the heart from a light source. Unfortunately, since you get one color, I had to use a transparent pixel which doesn't look right on a black background. Quote Link to comment Share on other sites More sharing options...
bogax Posted April 9, 2014 Share Posted April 9, 2014 Two off topic suggestions rand is a call to a different bank, you might want to consider using inlinerand I'd try dealing with the sprites using indexing Quote Link to comment Share on other sites More sharing options...
+Gemintronic Posted April 10, 2014 Author Share Posted April 10, 2014 Two off topic suggestions rand is a call to a different bank, you might want to consider using inlinerand I'd try dealing with the sprites using indexing Good idea about the rand. I'm not quite savvy enough to pick up on the sprite indexing. Could you explain that in more detail? Right now I "launch" the sprites every 10 clicks of the counter variable. Assuming the sprites are moving down one pixel each iteration of the main loop this guarantees a 10 pixel vertical spacing between sprites (thus avoiding flicker). Quote Link to comment Share on other sites More sharing options...
bogax Posted April 10, 2014 Share Posted April 10, 2014 Good idea about the rand. I'm not quite savvy enough to pick up on the sprite indexing. Could you explain that in more detail? Right now I "launch" the sprites every 10 clicks of the counter variable. Assuming the sprites are moving down one pixel each iteration of the main loop this guarantees a 10 pixel vertical spacing between sprites (thus avoiding flicker). I'm afraid there's some junk in this code but it should give you the idea. msflicker_wloops.bas for one thing, I modified the counter so it (partialy) runs a little faster. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.