HeroMan - Løsningseksempel - Delopgave 13
Tilret så heroMan’s hastighed er parameter i HeroMans klassen’s constructor. Tilret også så den grønne mands farve og maksimale hastighed er parametere i GreenAngryMan klassens constructor. Tilret contructoren så den grønne mand får en tilfældig højeste hastighed hver gang man starter spillet.
Sådan kan koden se ud: https://editor.p5js.org/JensValdez/sketches/Puxo9WIWA
HeroMan - Solution Example - Subtask 13
Adjust so that heroMan's speed is a parameter in the HeroMan class's constructor. Also adjust so that the green man's color and maximum speed are parameters in the GreenAngryMan class's constructor. Adjust the constructor so that the green man gets a random maximum speed every time you start the game.
A possible solution in code:https://editor.p5js.org/JensValdez/sketches/Puxo9WIWA