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.

Code Snippets / [DBP] My pixel perfect collision system

Author
Message
Gatorules
15
Years of Service
User Offline
Joined: 17th Dec 2008
Location:
Posted: 1st Feb 2010 03:50
Pixel perfect collisions never seemed to work for me so I wrote my own. enjoy:

Trolling
14
Years of Service
User Offline
Joined: 22nd Feb 2010
Location:
Posted: 23rd Feb 2010 01:16
Hiya, Im new to BarkBasic (but not to programming in general) - Now I havent examined the DB compiler in depth so please forgive me if this is a silly statement/question..

Surely it is quicker to set a variable to the value of any repeatedly used function and reference that rather than have the function re-evaluated?

ie

any function (like "Sprite Width(Sprite1)") which is reference repeatedly should have its value copied to a variable ("SpriteWidth1=Sprite Width(Sprite1))" and then used instead - I dont know but I suspect most compilers won't notice the repeated references spread over a function and optimize the references accordingly) - even if the value of the variable is changed throughout the function, it can be reassigned back to the objects property before the function is finished?

..erm... squiggle

Login to post a reply

Server time is: 2024-03-28 21:58:58
Your offset time is: 2024-03-28 21:58:58