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.

DarkBASIC Professional Discussion / diagonal fade algorithm?

Author
Message
Phaelax
DBPro Master
23
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 2nd Jan 2014 13:07
Title is probably confusing, hard to put in one line the kind of effect I'm after, so here's some code. (press spacebar to trigger effect)


Given a block of objects, I want to gradually show them on the screen in a diagonal fashion. I'm having a brain fart on how to apply the effect to the second half of the blocks. Run the code and you should figure out what I'm talking about.




MonoCoder
20
Years of Service
User Offline
Joined: 4th Dec 2005
Location: england
Posted: 2nd Jan 2014 14:13 Edited at: 2nd Jan 2014 14:23


Basically ax and ay carry on to twice the width/height, and then in the do-the-effect loop their values are taken and clamped at width/height to stop them going out the array.


edit: slightly optimised, only ax needs to go beyond limit.

Phaelax
DBPro Master
23
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 2nd Jan 2014 18:26
Ah yes, duh! Thanks

Login to post a reply

Server time is: 2026-07-06 07:50:38
Your offset time is: 2026-07-06 07:50:38