Bots playing a full round.
This commit is contained in:
parent
f827795dd8
commit
c7b2d5e8c5
1 changed files with 8 additions and 4 deletions
|
@ -56,7 +56,8 @@ ggsNetworkReceivedCommandWithArgs(Command, Args) ->
|
||||||
"player1_points" ->
|
"player1_points" ->
|
||||||
new_round();
|
new_round();
|
||||||
"player2_points" ->
|
"player2_points" ->
|
||||||
new_round()
|
new_round();
|
||||||
|
_ -> ok
|
||||||
end.
|
end.
|
||||||
|
|
||||||
welcome(Who_am_I) ->
|
welcome(Who_am_I) ->
|
||||||
|
@ -103,8 +104,11 @@ gameTick() ->
|
||||||
case BallY < (MeY - 5) of
|
case BallY < (MeY - 5) of
|
||||||
true ->
|
true ->
|
||||||
ggs_network:send_command("up", "");
|
ggs_network:send_command("up", "");
|
||||||
false ->
|
_ -> case BallY > ( MeY - 5) of
|
||||||
ggs_network:send_command("down", "")
|
true ->
|
||||||
|
ggs_network:send_command("down", "");
|
||||||
|
_ -> ok
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
@ -233,7 +237,7 @@ handle_cast({paused, Paused}, State) ->
|
||||||
NewState = dict:store(paused, Paused, State),
|
NewState = dict:store(paused, Paused, State),
|
||||||
{noreply, NewState};
|
{noreply, NewState};
|
||||||
|
|
||||||
handle_cast({new_rouned, Paused, SendStart}, State) ->
|
handle_cast({new_round, Paused, SendStart}, State) ->
|
||||||
State1 = dict:store(paused, Paused, State),
|
State1 = dict:store(paused, Paused, State),
|
||||||
NewState = dict:store(send_start, SendStart, State1),
|
NewState = dict:store(send_start, SendStart, State1),
|
||||||
{noreply, NewState};
|
{noreply, NewState};
|
||||||
|
|
Reference in a new issue