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 / Using a pre-calculated sine wave for a figure eight

Author
Message
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 26th Sep 2013 22:11
So, I needed this for my current Tier 2 WIP and worked it out in Tier1 because it was easier to do that testing and prototyping there.

In my WIP, I will take the curve and rotate it to the correct position. But that code is a little more complex and currently uses custom structs and classes.

Anyway, play with the wl# value to make the curve longer or shorter and amp# to change the height:


Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
george++
AGK Tool Maker
17
Years of Service
User Offline
Joined: 13th May 2007
Location: Thessaloniki, Hellas
Posted: 26th Sep 2013 22:26
Thank you Ancient Lady,
Useful, clean and well documented piece of code
I am thinking if it can be used to form an incoming enemy wave
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 26th Sep 2013 22:31
Thank you.

I will try to find the time to translate my rotation code into Tier 1. It is actually quite useful. I started with creating the coordinates for a winding path along a straight line and then rotate the path to the actual target start and stop points. It took a bit of fiddling, but I now have a workable set of code.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 26th Sep 2013 23:42
In the spirit of sharing (and as I will be borrowing yours!) I hope you don't mind me adding my T1 progressions to your thread. I use these to add some very simple but highly effective fades, moves and spins. I load them up into arrEffectProgress[] as 100 values, the range of each one being 0 to 1.

Examples of usage are fading objects in from fast to slow, and scaling up menu buttons as they pop on screen.



Login to post a reply

Server time is: 2024-11-24 19:22:59
Your offset time is: 2024-11-24 19:22:59