Flint Particle System Forum - Starfield Generation 2010-12-25T18:50:44+00:00 http://flintparticles.org/forum/ Lussumo Vanilla & Feed Publisher Starfield Generation http://flintparticles.org/forum/comments.php?DiscussionID=38&Focus=192#Comment_192 2008-06-06T02:40:31+01:00 2010-12-25T18:50:44+00:00 britg http://flintparticles.org/forum/account.php?u=32 Howdy, I apologize in advance because I haven't spent any real substantive time with the flint particle system yet, but I was wondering if it is the right tool to help with starfield ...
Here is the how it will be used:
- the game is a space shooter
- the player's ship is stationary in the center of the screen
- movement is simulated by the startfield reacting to user-input (i notice v1.0.3 was just released with keyboard events)

I have actually written my own code for this but I have a distinct feeling it's not up to par as it maxes out my cpu while moving! haha.

I don't necessarily want to know "how do I do this" as I enjoy writing the code and learning a tool. Simply, in your qualified opinion, is this the correct tool to get started with? Is there another tool out there that is better?

Thanks in advance!]]>
Starfield Generation http://flintparticles.org/forum/comments.php?DiscussionID=38&Focus=194#Comment_194 2008-06-06T07:51:13+01:00 2008-06-06T07:51:26+01:00 Richard http://flintparticles.org/forum/account.php?u=1 Hi, and welcome. Flint could certainly do this and I don't know of any tools that are better suited than Flint for it. In fact, knowing Flint as I do, I can imagine knocking it up in half and hour or ... Starfield Generation http://flintparticles.org/forum/comments.php?DiscussionID=38&Focus=195#Comment_195 2008-06-06T14:09:27+01:00 2010-12-25T18:50:44+00:00 britg http://flintparticles.org/forum/account.php?u=32 Thanks, good to know. Starfield Generation http://flintparticles.org/forum/comments.php?DiscussionID=38&Focus=197#Comment_197 2008-06-08T16:15:35+01:00 2010-12-25T18:50:44+00:00 britg http://flintparticles.org/forum/account.php?u=32 Here's a question for ya as I'm working through this. Is there a way to set the emitter's counter to multiple KeyDownCounters? For instance, I want particles to be generated whenever I press the ...
I image that if there isn't a solution already in place, that I should modify the KeyDownCounter to accept an array of keys?


public function KeyDownCounter(counter:Counter, keys:Array, stage:Stage)
...


Am I conceptualizing this correctly?]]>
Starfield Generation http://flintparticles.org/forum/comments.php?DiscussionID=38&Focus=198#Comment_198 2008-06-09T06:07:47+01:00 2010-12-25T18:50:44+00:00 britg http://flintparticles.org/forum/account.php?u=32 Well, I think I answered my own question - I ended up not changing your KeyDownCounter and instead did the following: - went with a Steady() counter - added a Move() action - added a ...
- went with a Steady() counter
- added a Move() action
- added a TargetVelocity() action instead of a Velocity() initializer
- updated the TargetVelocity during the game loop and fed it x and y velocities
- paused the emitter if x and y velocity go to 0

This all worked better than the KeyDown classes because the ship may still be drifting when a key is not pressed.

I have to say Richard, this is a great framework you've got going here! Here's the result of about 2 days of playing - still a few quirks but overall it runs well and was easy to implement:
http://ss.as3gaming.com/spacesurvivor.html

A couple of issues - can't figure out how to 'run ahead' when no Velocity initializer is in place, but to be honest I haven't tried very hard. Have any thoughts on that?

Also, I placed a MultiZone comprised of 4 LineZones around the edges of the game screen so that stars can be generated from anywhere based on the velocity vector. I'm afraid though that this may be inefficient, because only 2 zones at most are producing visible particles, whereas the other 2 are creating particles that are immediately DeathOffStaged(). Is this a valid concern, and do you know of a better way of doing it?

Again, thanks for sharing this great library.]]>
Starfield Generation http://flintparticles.org/forum/comments.php?DiscussionID=38&Focus=199#Comment_199 2008-06-09T07:54:18+01:00 2010-12-25T18:50:44+00:00 Richard http://flintparticles.org/forum/account.php?u=1 can't figure out how to 'run ahead' when no Velocity initializer is in place, but to be honest I haven't tried very hard. Have any thoughts on that? I assume this is about filling the screen with ... can't figure out how to 'run ahead' when no Velocity initializer is in place, but to be honest I haven't tried very hard. Have any thoughts on that?

I assume this is about filling the screen with stars at the start. The run ahead simply calculates and applies a number of frames based on the current settings. If you tell it the ship is moving - whatever the effects of that are - then the stars should move accordingly (and instantaneaously, so you don't see the movement.

However, a better option may be to operate the emitter in two phases. The first phase uses a position initializer using a rectangle zone covering the stage and a blast counter to create a number of particles. You call start on this emitter, causing the particles to be created and placed randomly over the stage. then you change to phase 2 - change the counter to a steady counter and change the zone on the position initializer to the four lines around the stage, so now the system works as you've designed.

I placed a MultiZone comprised of 4 LineZones around the edges of the game screen so that stars can be generated from anywhere based on the velocity vector. I'm afraid though that this may be inefficient, because only 2 zones at most are producing visible particles, whereas the other 2 are creating particles that are immediately DeathOffStaged(). Is this a valid concern, and do you know of a better way of doing it?

I don't think it's of great concern - you don't seem to be having any speed issues. Also, it's worth noting that a DeathZone with a rectangle the size of the stage is a lot more efficient than a DeathOffStage, so if you have speed issues switching to a DeathZone would be the first thing to change.]]>