Is this Collide command Viable?

Non-platform specific questions.

Is this Collide command Viable?

Postby poopbrigade » Tue Apr 27, 2010 7:57 am

is this possible????
I want my player to move up when it collides with spring(by the way I've noticed that -y is up and +y is down should it be the other way around?)


if (CollisionFree("Event Actor", spring.x, spring.y)) y=y-5;
When life gives you oranges, make orange juice. When life gives you poop, make fertilizer not poop juice.

Image
Current project __ CorPsEdEaRtH
Estimated work done __ 12%
User avatar
poopbrigade
 
Posts: 129
Joined: Thu Aug 27, 2009 12:17 pm
Location: In Earth. Being Burried XD
Score: 46 Give a positive score

Re: Is this Collide command Viable?

Postby Hblade » Tue Apr 27, 2010 1:23 pm

Wouldn't this work?

Coliision with Spring from character:
Code: Select all
yvelocity-=32;

That should simulate a basic method of bouncing off of a spring :D
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: Is this Collide command Viable?

Postby Thanx » Tue Apr 27, 2010 5:44 pm

actually that code should be
Code: Select all
yvelocity = -32;

Because HBlade's code only subtracted from the already existing yvelocity... So if it were faster, it still would have continued falling, just at a slower speed.
If you want to simulate faster objects being accelerated better, then I suggest something like this:
Code: Select all
yvelocity = -32 * (yvelocity/somenumber);

In place of somenumber just write in a number which will serve as some kind of a ratio, as for how sensitive the spring is. Experiment with the number until you achieve the desired effect...
:)
Last edited by Thanx on Tue Apr 27, 2010 6:15 pm, edited 1 time in total.
http://www.youtube.com/watch?v=XyXexDJBv58
http://www.youtube.com/watch?v=Be4__gww1xQ
These are me and playing the piano (second one with a friend/fellow student)
Hope you watch and enjoy!
User avatar
Thanx
 
Posts: 314
Joined: Sat Jan 26, 2008 10:07 pm
Location: Home sweet home! :)
Score: 24 Give a positive score

Re: Is this Collide command Viable?

Postby Hblade » Tue Apr 27, 2010 6:08 pm

Wow good job thanx!
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest