TowerDefense | C tower defense with SFML lib | Game Engine library
kandi X-RAY | TowerDefense Summary
kandi X-RAY | TowerDefense Summary
Game made by Ambroise rabier, my first project in c++. I've inspired myself from Unity and from previous projects I've worked on to make my own 'game engine' based on SFML library. I own no rights over music and graphics being used as placeholders. Looking for a game artist and a game designer to make this game more interesting. Contact me by mail. Any feedback is welcome: rabier.ambroise@outlook.fr.
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 TowerDefense
TowerDefense Key Features
TowerDefense Examples and Code Snippets
Community Discussions
Trending Discussions on TowerDefense
QUESTION
I am trying to make a Towerdefense Game to check if the Enemy is in the hitcircle of the tower I want to use the function pygame.sprite.collide_mask to find out if they are touching.
This is the output: AttributeError: 'pygame.mask.Mask' object has no attribute 'add_internal'
How can I make it work? Am I even remotely in the right direction of detecting the collision for the game?
I hope this code can work as much as it needs
...ANSWER
Answered 2022-Mar-11 at 16:33collide_mask
use the .rect
and .mask
object of the Spirte. Therefore the name of the Mask attribute must be mask
, but not tower_mask
or enemy_mask
.
In addition, the objects must have an attribute named rect
, which is a pygame.Rect
object with the position of the sprite.
Also the super
calls a missing from your class constructors. e.g.:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install TowerDefense
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