HeroMan - Løsningseksempel - Delopgave 21
Lav en ny klasse ved navn AngryMan som GreenAngryMan og RedAngryMan klassen nedarver fra. Den skal indehold de variabler og metoder som er fælles for de to eksisterende klasser. AngryMan klassens constructor skal tage “colour” som parameter.
Sådan kan koden se ud: https://editor.p5js.org/JensValdez/sketches/cge0Hv2WQS
HeroMan - Solution Example - Subtask 21
Create a new class called AngryMan from which the GreenAngryMan and RedAngryMan classes inherit. It should contain the variables and methods that are common to the two existing classes. The AngryMan class's constructor should take “colour” as a parameter.
A possible solution in code:https://editor.p5js.org/JensValdez/sketches/cge0Hv2WQS