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.

Author
Message
BeastDeath
15
Years of Service
User Offline
Joined: 7th Jul 2011
Location:
Posted: 14th Aug 2011 22:29
Hello, just a question, how can I test whether something is being changed by a specific value.

I want to check whether one of my variables is going down rapidly. So basically I have y#, my player's y# axis is always being taken down by gravity and when it collides with something, the y axis of my player is now 0.

I want to test whether a variable such as the y axix# is going down by 3, (enter falling state) do code there etc, how would I check that? Hopefully some people will understand what I'm talking about.
BatVink
Moderator
23
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 15th Aug 2011 01:15
You have to make that change yourself, so you will always know if it is being changed. I don't understand why you wouldn't know it is changing?

SH4773R
16
Years of Service
User Offline
Joined: 18th Jan 2010
Location: AMERICA!!!
Posted: 15th Aug 2011 01:19 Edited at: 15th Aug 2011 01:23
Would this work for you?

yincrease = amount to increase y by
y = current y amount



Quote: "You have to make that change yourself, so you will always know if it is being changed. I don't understand why you wouldn't know it is changing?"

I do agree with this though

Webber
15
Years of Service
User Offline
Joined: 27th May 2011
Location:
Posted: 15th Aug 2011 02:11
Sometimes you don't always know exactly what is going on inside of your program.
It can make it a lot easier if you could see the numbers inside your variables yourself.
You can display the values of all of your variables using the print command.
That's what I do for testing my variables.

If I had 3 variables (x#, y#, and z#), and I also wanted to check the frames per second.
I would display them to the screen with this code.



Its a very easy, and useful way of checking if your variables are working correctly.

Hope this helps.

I like games, and stuff.
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 15th Aug 2011 19:59 Edited at: 15th Aug 2011 20:00
If y# = Lasty#-3.0 then gosub whatever
Lasty# = y#

Login to post a reply

Server time is: 2026-07-11 03:38:44
Your offset time is: 2026-07-11 03:38:44