Dirichi / SimpleSoccerManager

Soccer manager game written in javascript with p5.js
0 stars 0 forks source link

weird player movements #1

Open Dirichi opened 8 years ago

Dirichi commented 8 years ago

keeper sometimes moves like regular outfieldplayers and sometimes players in the "shooter" state keep moving. should be fixed by using statemeachines that determine player movements and are controlled by Game and Team objects.

Suggested states:

if(teaminAttackState){
    outfieldplayers.setState(makingAttackingRuns)
    keeper.setState(neutral)
    focusPlayer.setState(roaming)
}

if(teamInDefenseState){
    outfieldplayers.setState(makeDefensiveRuns)
    keeper.setState(keepermovement)
    focusPlayer.setState(chaseBall)
}
if(teamInNeutralState){
    allPlayers.setState(neutral)
}

if(teamInKickOffState){
    outfieldplayers.setState(preparingForKickOff)
    keeper.setState(preparingForKickOff)
    if(gameIsReadyForKickOff){
          focusPlayer.setState(chaseBall)

   }

}

and so on and so forth

Dirichi commented 8 years ago

just figured this could all be fixed with a lerp. Gonna have to rewrite all the move functions now