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.

2D All the way! / How can i make my code run smoother, when i run it its dead blocky movement

Author
Message
PowerMan
21
Years of Service
User Offline
Joined: 22nd Jan 2005
Location: Manchester
Posted: 4th Mar 2005 09:21
when i load up and run its not as smooth as i want it does anyone know why?

Matrix Man
21
Years of Service
User Offline
Joined: 27th Jul 2004
Location:
Posted: 5th Mar 2005 05:23
im quite new to programmin but i think you should make the inc's and dec's lower because its jumping too fast across the screen if its the charcter or ship that looks unsmooth
PowerMan
21
Years of Service
User Offline
Joined: 22nd Jan 2005
Location: Manchester
Posted: 5th Mar 2005 18:20
thanks alot matrix man that did do it a bit but its still jerky
pizzaman
22
Years of Service
User Offline
Joined: 18th Feb 2004
Location: Gateshead, UK
Posted: 5th Mar 2005 22:48 Edited at: 5th Mar 2005 22:49
How many frames per second (FPS) is your game running at?
Also take out the print command and replace it with the text command.

Therefore this
becomes this


BTW you can shorten your image loading which is currently by replacing
with


pizzaman
22
Years of Service
User Offline
Joined: 18th Feb 2004
Location: Gateshead, UK
Posted: 5th Mar 2005 22:51 Edited at: 5th Mar 2005 22:54
(Sorry double post)

pizzaman
22
Years of Service
User Offline
Joined: 18th Feb 2004
Location: Gateshead, UK
Posted: 5th Mar 2005 22:52 Edited at: 5th Mar 2005 22:55
(Sorry triple post - don't know how this happened?)

PowerMan
21
Years of Service
User Offline
Joined: 22nd Jan 2005
Location: Manchester
Posted: 16th Mar 2005 18:51
it looks like i have got my sync rate to 0, but this should not matter should it. i know that it gets really slow beacuse of my tiling scrolling background. i tried to use that index code snipit you gave me but it gives me an error? when i stop loading the background it is great how do i ressolve this?
dj chainz
21
Years of Service
User Offline
Joined: 25th Sep 2004
Location: England
Posted: 28th Mar 2005 05:38
Dont just decrement the position of an object - decrement it based upon the time since last frame. This gives it a smooth appearance. Put something like this in the loop:

oldtime=time
time=timer()
temp=time-oldtime
temp=temp*(pixels-per-second/1000)
(move objects with temp)
oldtime=time

I am the lead programmer at red spark studios
http://www.brazilianhotties.tk

Login to post a reply

Server time is: 2026-07-14 11:05:51
Your offset time is: 2026-07-14 11:05:51