wallbreaker | Arkanoid/Breakout clone written in C and SFML | Game Engine library
kandi X-RAY | wallbreaker Summary
kandi X-RAY | wallbreaker Summary
Arkanoid/Breakout clone written in C++ and SFML
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of wallbreaker
wallbreaker Key Features
wallbreaker Examples and Code Snippets
Community Discussions
Trending Discussions on wallbreaker
QUESTION
I'm a first grader of a software engineering study and I have some trouble with a showcase I have to make. I give you a quick rundown of my project.
I don't know if anyone is familiar with the game Clash Royal? Its a game based on getting higher in trophies and collecting cards. And each arena unlocks new cards.
I want to make a deck builder. Where you can select 8 cards, and I calculate the average elixer cost. I want a function that can display all the cards available for your trophy range.
With that out of the way, let me explain my problem: I made a Superclass: Card, and the classes Troop, Spell, DefBuilding, and PassiveBuilding extend on that superclass. After that, I created a class: CardPool where I defined all the objects for all the "Card classes".
Then I made a Class: Arena, and in my main, I declared all the arenas. The thing I am struggling with is the fact that I don't know how I putt all a few cards in a vector of the matching Arena. Something like card 1-2-3 needs to go into a vector of Arena 1 and card 4-5-6 need to go in a vector Arena 2. Only I have 4 different Classes witch all are cards.
So the actual question is as follow: How can I make a vector list of Arena 1 (or 2,3,4) and put 2 Troops, 1 spell, 1 defBuilding into that vector list? And eventually, be able to display them.
The last ting I tried was to Cast the class as you can see in my CardPool class. That didn't work.
note: I made my Class CardPool an interface just to try things out, heard something on school about it.
Superclass: Card
...ANSWER
Answered 2019-Apr-16 at 20:01You're casting to CardPool
not Card
. You would have to make Card
implement CardPool
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install wallbreaker
Install SFML (www.sfml-dev.org). For Debian/Ubuntu, install libsfml-dev package.
Run the make command: make
Run game: ./wallbreaker
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page