[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[pygame] Friction help
- To: pygame-users@xxxxxxxx
- Subject: [pygame] Friction help
- From: kiliansto@xxxxxxxxx
- Date: Tue, 13 Jan 2009 19:49:58 -0600
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Tue, 13 Jan 2009 20:50:01 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type; bh=t00ODBREgLdQeWExY7wrOmgeq3zV7wE6jqYhosM2DoA=; b=PI8+MIecMuRoxErO65yjYXmiq+0ZJybad+a0/aOx/YLPWnHripSROM0JmRYTkLE95Q wjUhxKfaIcPzffO54Ruh/on2G4ZgNhIj1E95LZn38RvLOGL86XssG5gh05/ZwzDIQPLv uuJuqRCSU91PMlnOpVsPuFqwZJ16mQzkByzgI=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=HEwfVvrggHiWEp6BNolqbnk3V2NmeEfyw5nv9rni8V+wnOTEv+ejBaM2xPBx52bBQh Pzq/6tTwoXL5WDrsPJ85DGZDj4jeNfQN0oke/h9NvtaIXAcONPvS4XtgahPZZ1Jojpya dkltgDRwAgKxcfvDf/R7S61niJAoNpAlql1SQ=
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
I'm trying to implement a basic user controlled sliding box with
pygame. I have everything worked out, except for two things.
The acceleration is changed once a second (for meters/second) this
leads to very jumpy movement. I need to add a way to check how long it
takes the program to loop and multiply the acceleration by that much.
(I think)
After I move, the box slows down appropriately, but then the speed
passes 0 and the box shoots off the other way. The equation (in real
life) is mS (Coefficient of static friction)*Normal Force >= friction
force. So lets say I am slowing down at a rate of -2m/s^2, if I hit 1,
the next number will be -1 and I shoot off in the other direction. How
do I fix this an still have backwards movement?