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.

Dark GDK / Weird behaviour

Author
Message
Yero008
13
Years of Service
User Offline
Joined: 5th Dec 2010
Location: Romania
Posted: 28th Feb 2012 18:02
Hi,

I compiled the game at home and it worked very good. But when I got to school i had a problem. In the game i have a platform that goes up and down. As I said at home it was going up and down, but at school it kept going up but it never returned. I compiled my game as a release, and everything else as far as I can see is working OK.
What can I do? If neccesary i'll post the code for the movement.

Forward thanks!
Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 28th Feb 2012 23:55
That is strange. Post the code.

The fastest code is the code never written.
Yero008
13
Years of Service
User Offline
Joined: 5th Dec 2010
Location: Romania
Posted: 29th Feb 2012 09:48

naveta is the object, and sw is declared globally.
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 29th Feb 2012 16:40
I suppose there is a chance the object y position is never exactly 400. Try changing the code to yPos < 0 and yPos > 400.

Floating point values can give slightly different results on different machines.

Another solution may be to cast it to an int.
(int)yPos == 400.

Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 29th Feb 2012 17:30
Matty H is correct. Never use exact numbers when using floats (which objects do). Use a range or <> like:


The fastest code is the code never written.
Yero008
13
Years of Service
User Offline
Joined: 5th Dec 2010
Location: Romania
Posted: 1st Mar 2012 08:32
Thank you! It worked. Now it's going up and down.

Login to post a reply

Server time is: 2024-04-26 10:00:11
Your offset time is: 2024-04-26 10:00:11