Thread: Gravity
View Single Post
  #9  
Old 05-14-2005, 10:16 PM
Velox Cruentus Velox Cruentus is offline
Registered User
Velox Cruentus's Avatar
Join Date: Dec 2004
Location: Quebec, Canada
Posts: 465
Velox Cruentus is on a distinguished road
Send a message via ICQ to Velox Cruentus Send a message via AIM to Velox Cruentus
Horrible.

PHP Code:
//#CLIENTSIDE
if (created) {
  
disabledefmovement;
}
if (
timeout)
{
  
this.mx = (keydown(0) - keydown(2))/2;
  
this.my = (keydown(3) - keydown(1))/2;
  if (!
onwall(playerx this.mx,playery))
    
playerx += this.mx;
  if (!
onwall(playerx,playery this.my))
    
playery += this.my;

  
playery += 0.1;
  
timeout 0.05;

This is a lot better, but may not be what you want (I just rescripted what you did)

Try to keep it short and simple, and make sure that you don't get conditions where events should go... Use KSI-GS... Think about what you really want.


--- EDIT:

Something you might want to take in consideration is that the gravitational pull accellerates with time. Thereby, a constant for the decrease wouldn't be what you're aiming for.
__________________
In a world of change... Who'll you believe?
Reply With Quote