Problem: The players proximity to the bomb needs to be detected
Inputs: playerLocX, playerLocY, bombX, bombY
Outputs: Color.colour of oval graphic
Processing: All players
if playerLocX > bombX - 20
and
playerLocX < bombX + 20
and
playerLocY > bombY - 20
playerLocY < bombY + 20
then
change graphic set colour
draw oval
Pseudocode
Players proximity to bomb
Get playerLocX, playerLocY, bombX, bombY
if playerLocX > bombX - 20
and
playerLocX < bombX + 20
and
playerLocY > bombY - 20
and
playerLocY < bombY + 20
then
change graphic set colour
draw oval
else
end
end
2.
Problem: The players proximity to other players needs to be detected
Inputs: playerLocX, playerLocY
Outputs: Color.colour of graphic oval
Processing: All players
if playerLocX > playerLocX - 20
and
playerLocX < playerLocX + 20
and
playerLocY > playerLocY - 20
and
playerLocY < playerLocY + 20
then
change graphic set color
draw oval
Pseudocode
Players proximity to other players
Get playerLocX, playerLocY
if playerLocX > playerLocX - 20
and
playerLocX < playerLocX + 20
and
playerLocY > playerLocY - 20
and
playerLocY < playerLocY + 20
then
change graphic set color
draw oval
else
end
Inputs: playerLocX, playerLocY
Outputs: Color.colour of graphic oval
Processing: All players
if playerLocX > playerLocX - 20
and
playerLocX < playerLocX + 20
and
playerLocY > playerLocY - 20
and
playerLocY < playerLocY + 20
then
change graphic set color
draw oval
Pseudocode
Players proximity to other players
Get playerLocX, playerLocY
if playerLocX > playerLocX - 20
and
playerLocX < playerLocX + 20
and
playerLocY > playerLocY - 20
and
playerLocY < playerLocY + 20
then
change graphic set color
draw oval
else
end