Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / spiral effect

Author
Message
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 21st Sep 2012 13:40
i would like to make a kind of spiral effect where a sprite moves left and right, starts moving a little distance at the bottom of the screen, and the distance increases as it moves left-right towards the top of the screen. like a spiral effect seen sideways.

would it be best to do this with some standard sin/cos formula or with particles?

obviously i need to have quite a lot of sprites!!!

Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 21st Sep 2012 14:23
I would use sprite myself, I'm not sure that the particle system could do the job, really needs access to individual entities.

I'd have a start position at the base of the tornado, start a sprite there with a random offset and random speed. Then if the sprite is to the right of the spawn, decrease the X speed otherwise increase the X speed... all the while decreasing the Y position. I think that starting the sprites with a slow speed would make them gradually speed up, as they fly past the start position... If not, you could increase the limit of the X speed as the Y speed increases, so particles higher up can go faster. So it wouldn't use SIN or COS, but it would be smooth left and right movement.

The sheer number of sprites you'd need to replicate the image might be scary though - perhaps you'd be better off with more obvious sprites... like leaves for instance being blown around in a hurricane - you'd get away with using far less sprites that way. Also, if you can make the leaves, crisp bags, old nappies, carrier bags, feathers, seeds, cows, shed roofs or whatever react to collisions, then it just looks awesome. In a game I used leaves blowing off trees, they'd bunch up on the ground and be blown about by wind, and the sprites were pretty big too, still looked cool. Would be awesome if trash or leaves etc settled on the ground, then this tornado sweeps them back up again. Depends on what you need the hurricane for I guess.

Anyhoo, I could probably make a small example of the idea if you like.

Health, Ammo, and bacon and eggs!
Hodgey
15
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 21st Sep 2012 14:33 Edited at: 21st Sep 2012 14:33
I'm with Van B on this one - use sprites with sin/cos. I've whipped up a small demo, you can sort of get the idea. I didn't quite replicate a tornado because I can't be bothered to set up structs/classes right now so it's pretty elementary. This was written on a Mac so just grab the relevant functions.



bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 21st Sep 2012 15:21
thanks guys.

yes i think it's better to go with sprites as i would have much more flexibility to use alpha etc.

i will test out you example Hodgey asap.
Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 21st Sep 2012 22:36 Edited at: 21st Sep 2012 22:38
Although I agree that using sprites would work better, here's a spiral with particles...



Attachments

Login to view attachments
Marl
13
Years of Service
User Offline
Joined: 19th Nov 2011
Location: Bradford, UK
Posted: 21st Sep 2012 23:28
Very Nice Rich.

I presume the spinning effect is an optical illusion - 'cos I simply can't convince my brain its not 3D
Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 21st Sep 2012 23:38
yep, the particles just go left a little, then right a little, then left a little more, and so on.

It's all in your mind

bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 22nd Sep 2012 21:23
will try this out
thanks
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 22nd Sep 2012 21:29
Rich, your example looks really great and fasssstttttt!

I think that with some tweaking I will get the effect I want!

As I stated many times before, AppGameKit particles engine is really good, we just need a couple of extra commands to make it AAA
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 22nd Sep 2012 21:55
Rich, that is a cool demo!

Cheers,
Ancient Lady
AGK Community Tester
Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 22nd Sep 2012 23:25
Thanks for the kind words!

Of course, I've played around with AppGameKit particle commands a bit, but agreed, a few more commands would really make them great.

baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 22nd Sep 2012 23:58
There can't be many people on the forums who know particles like you Rich! That's clever stuff sir. I haven't really used them much because I like to make my own particles so I never realised they had time based forces, that's pretty useful for stuff like this!

Yes, if particles had scaling and rotation manipulation there wouldn't be a need for creating our own particle systems very often. I'd like to see full physics particles too that have their own gravity system and even attraction... we could then create water / smoke and a number of other effects that react to a physics environment. Currently we have to do that manually which is a pain sometimes.

Still there wouldn't be much fun left if the language did it all for us would there?


this.mess = abs(sin(times#))
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 23rd Sep 2012 17:12
baxslash no need for complex gravity and physics particles for now.

if we had scaling and rotation it would be more than enough to have a really good usable engine that could do a lot of things.
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 24th Sep 2012 08:47
True, but physics would be nice too...


this.mess = abs(sin(times#))
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 24th Sep 2012 16:30
Quote: "True, but physics would be nice too..."

Images of small airplanes sent into the middle of tornadoes...

Cheers,
Ancient Lady
AGK Community Tester

Login to post a reply

Server time is: 2024-11-23 23:25:40
Your offset time is: 2024-11-23 23:25:40