Zie onderaan pagina voor minimale klasse-hiërarchie en interfaces.
Maak een spel dat als volgt werkt:
De speler dient met zijn pion de overkant van het veld te bereiken.
Het veld bestaat uit 20 bij 20 vakjes. Op ieder vakje kan maximum één mapelement staan:
De speler zelf
Een monster
Een rots
Een speler kan niet door rotsen of monsters wandelen.
Een speler kan in zijn beurt telkens één vakje bewegen OF naar rechts schieten:
Indien geschoten wordt dan zal het mapelement op het vakje rechts van de speler vernietigd worden (rots of monster)
Monsters kunnen ook bewegen. In de beurt van de monsters beweegt ieder monster in een willekeurige richting indien er geen rotsen of spelers LINKS van het monster staan.
Indien er WEL een rots of speler LINKS van het monster staat dan schiet het monster en vernietigd het de speler of rots.
Enkel RockDestroyer monsters kunnen schieten. De setup van het spel bestaat uit volgende stappen:
Maak een 20 bij 20 array aan en plaats bepaalde hoeveelheid monsters en rotsen op de kaart, behalve op kolom 0.
Plaats de speler op de plek 0,10 in de array (midden van kolom 0)
Doorloop de volgende stappen tot er winnaar is
Iedere beurt van het spel bestaat uit volgende stappen:
Vraag speler om input (bewegen in 1 van de 4 richtingen OF schieten)
Voer actie van speler uit
Kijk of speler overkant van kaart heeft bereikt, zo ja: gewonnen!
Beweeg ieder monster op de kaart in een willekeurige richting
Beweeg iedere RockDestroyer OF laat RockDestroyer schieten
Stel de speler voor door een X, een rots door O , een monster door M een RockDestroyer door D.
Extra’s:
Voorgaande beschrijving is een ‘minimale’ beschrijving. Voorzie extra functionaliteit naar believen zoals:
Speler heeft levens
Monsters hebben levens
Andere soort monsters (bv slimmere)
Meerdere levels met telkens andere/meer monsters bijvoorbeeld
Meerdere spelers
Verder schieten, of schieten in andere richtingen.
Klasse-schema
Location is van het type Point (compositie). Point is een zelfgemaakte mini klasse die er als volgt uit (minimaal uitziet):
class Point
{
public int X{get;set;}
public int Y{get;set;}
}
En dus in je abstracte klasse MapElement zal iets krijgen in de trend van: public Point Location {get;set;} = new Point();
We gebruiken cookies op onze website om u de meest relevante ervaring te bieden door uw voorkeuren en herhaalde bezoeken te onthouden. Door op "Alles accepteren" te klikken, stemt u in met het gebruik van ALLE cookies. U kunt echter "Cookie-instellingen" bezoeken om een gecontroleerde toestemming te geven.
This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
Cookie
Duur
Omschrijving
cookielawinfo-checkbox-analytics
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional
11 months
The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy
11 months
The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.