News : The level of daily SPAM has reached insane proportions, all registrations are now manual. I ask you to send me an e-mail (john (at) murga (dot) org), to confirm that you want me to create an account for you.


Post Reply  Post Thread 
PONG
Author Message
iGame3D
Moderator
***


Posts: 231
Group: Moderators
Joined: Apr 2007
Status: Offline
Reputation: 0
Post: #1
RE: PONG

What does sleep do exactly.
If I set a high value like 100, I get a really slow play, but sleep 10 doesn't affect anything.

I imagine the glitchiness stems from the processor updating the movement faster than the
video card can update the screen. Just a guess. Can't seem to find any values on how fast
any video card actually updates the screen relative to how many times a loop cycles.

To keep the ball from speeding up on its own, change:
maxballspeed=9 -- to whatever you find comfortable
ballspeedinc=0.2 -- to zero if you want no auto speed increase, some

Do you still get keyboard delays with sleep?
I tried to run a test with Fl:event_text() to see what happens when you press a key.
Without the key held (and sleep 10) it returns to nil for about 20 cycles between my fastest ability to double tap it. On 3GHZ maybe its a lot more nil.
Or rather than nil, its just blank, since printing the result doesn't give the usual "nil" value Lua likes to give.

This is odd because if (Fl:event_text()== "r") then MBall:redraw() end seems to retain the
status of Fl:event_text() over time instead of only being when the key is down.

I've updated the code and Fluid in the original post.
I've added a little check and label for the total distance the ball travels.
At base speed its about 60 pixels per second and top speed its 540 per second.

This post was last modified: 04-22-2010 06:57 PM by iGame3D.

04-22-2010 06:20 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

Messages In This Thread
PONG - iGame3D - 04-21-2010, 10:37 PM
RE: PONG - mikshaw - 04-22-2010, 01:05 AM
RE: PONG - iGame3D - 04-22-2010, 04:56 AM
RE: PONG - mikshaw - 04-22-2010, 06:26 AM
RE: PONG - jpjacobs - 04-22-2010, 08:26 AM
RE: PONG - iGame3D - 04-22-2010, 02:19 PM
RE: PONG - mikshaw - 04-22-2010, 03:08 PM
RE: PONG - jpjacobs - 04-22-2010, 03:25 PM
RE: PONG - iGame3D - 04-22-2010 06:20 PM
RE: PONG - mikshaw - 04-23-2010, 06:04 AM
RE: PONG - iGame3D - 04-23-2010, 07:24 AM

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump: