Skip to content

Commit

Permalink
Fixed acceleration bug#2
Browse files Browse the repository at this point in the history
  • Loading branch information
JohsLoje committed May 16, 2018
1 parent 7378ac6 commit 7711b6b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions flappy_main_game/scripts/flappy.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,8 @@ def mainGame(movementInfo):
}

#update velocity
pipeVelX += playerAccX/FPS
playerVelY += playerAccY/FPS
pipeVelX += playerAccX
playerVelY += playerAccY

#limit velocity
playerVelY = limitVel(playerVelY,1)
Expand Down Expand Up @@ -573,8 +573,8 @@ def controlCallback(data):
global playerAccX
global playerAccY

playerAccX = limitAcceleration(-data.x/SCALING,ACCXLIMIT)
playerAccY = limitAcceleration(-data.y/SCALING,ACCYLIMIT)
playerAccX = limitAcceleration(-data.x/SCALING,ACCXLIMIT)/(FPS*FPS)
playerAccY = limitAcceleration(-data.y/SCALING,ACCYLIMIT)/(FPS*FPS)
#print(playerAccY)

def limitAcceleration(accUser,limit):
Expand Down

0 comments on commit 7711b6b

Please sign in to comment.