Advertisement
Guest User

Untitled

a guest
Nov 20th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. move(Etat,PlayerID,Direction,EtatResultant):-
  2. extract_playerposition(Etat,PlayerID,PositionX,PositionY),
  3. calcul_coordonee(PositionX, PositionY, Direction, DestinationX, DestinationY),
  4. updateState_move(Etat,PlayerID,DestinationX,DestinationY,EtatResultant).
  5.  
  6. updateState_move([N,M,C,R,Players,Blocks],PlayerID,DestinationX,DestinationY,[N,M,C,R,NewPlayers,Blocks]):-
  7. updateplayerlist_move(Players,PlayerID,DestinationX,DestinationY,NewPlayers).
  8.  
  9. updateplayerlist_move([Player|Others],PlayerID,DestinationX,DestinationY,[NewPlayer|Others]):-
  10. compareplayerid(Player,PlayerID),
  11. updateplayer_move(Player,DestinationX,DestinationY,NewPlayer).
  12. updateplayerlist_move([Player|Others],PlayerID,DestinationX,DestinationY,[Player|Autres]):-
  13. not(compareplayerid(Player,PlayerID)),
  14. updateplayerlist_move(Others,PlayerID,DestinationX,DestinationY,Autres).
  15.  
  16. updateplayer_move([ID,Name,_,_,Block],DestinationX,DestinationY,[ID,Name,DestinationX,DestinationY,Block]).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement