Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- move(Etat,PlayerID,Direction,EtatResultant):-
- extract_playerposition(Etat,PlayerID,PositionX,PositionY),
- calcul_coordonee(PositionX, PositionY, Direction, DestinationX, DestinationY),
- updateState_move(Etat,PlayerID,DestinationX,DestinationY,EtatResultant).
- updateState_move([N,M,C,R,Players,Blocks],PlayerID,DestinationX,DestinationY,[N,M,C,R,NewPlayers,Blocks]):-
- updateplayerlist_move(Players,PlayerID,DestinationX,DestinationY,NewPlayers).
- updateplayerlist_move([Player|Others],PlayerID,DestinationX,DestinationY,[NewPlayer|Others]):-
- compareplayerid(Player,PlayerID),
- updateplayer_move(Player,DestinationX,DestinationY,NewPlayer).
- updateplayerlist_move([Player|Others],PlayerID,DestinationX,DestinationY,[Player|Autres]):-
- not(compareplayerid(Player,PlayerID)),
- updateplayerlist_move(Others,PlayerID,DestinationX,DestinationY,Autres).
- updateplayer_move([ID,Name,_,_,Block],DestinationX,DestinationY,[ID,Name,DestinationX,DestinationY,Block]).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement