+grafixbmp Posted January 23, 2008 Share Posted January 23, 2008 I am wanting to use one of the missle for a rain effect on the game screen where a random function will display the missle in diffrent locations on the screen as the screen is being drawn. For a good portion of the screen, I want to place the missle at 'n' location horizontaly on the screen and possibly do 3 multiples, then do this same location for about 4 to 6 scan lines and then randomly change the horizontal location and do the same untill the screen is finished being drawn. Then for the next frame, have the locations be diffrent untill the scene changes then the program will check if this effect is still needed for the next scene. This is using an asymetrical playing field btw and each scan line uses new playfield data too. I also was thinking about while the missle is being displayed for 4 to 6 scanlines, have it tilt gradualy in a particular direction (ya know like rain drops) This may be easier to do with both missle but I wanted to use the other one for more important things. I just wanted to come up with a good random equation to make it look reasonably good for each frame. Quote Link to comment Share on other sites More sharing options...
vdub_bobby Posted January 23, 2008 Share Posted January 23, 2008 You can do a search for a pseudo-random number generator here in the programming forums, or search for LFSR. And you can "tilt" the rain drops by hitting HMOVE on every line with a small value in HMM0 or HMM1, whichever you are using. Completely repositioning the missiles every 4-6 scanlines is probably too much for what you want, though, it takes essentially an entire scanline, doing nothing else, to reposition an object... Hmmm. Why don't you post your kernel code? Maybe something tricksy can be fit in. Quote Link to comment Share on other sites More sharing options...
Robert M Posted January 25, 2008 Share Posted January 25, 2008 I think your best bet would be using a variation of the effect used to generate the stars in Cosmic Ark. Its documented somewhere. I don't have time to find it right now. 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.