Heya Sisters and Brothers!
I'm on my little learning project game and therefore was just about to solve a little mind puzzle for shooting a projectile onto an enemy and destroy it so hard!!!
El Problemo appears when my hitBox fields I just created aren't working. Actually I didn't tested them before that's why I came along this semantic error just now
I have two Entity Class types - one is called "Mack" and one is called "Mob" - Mack is the player here
Both have assigned a hitbox field (
hitBox = this.sprite.GlobalBounds()).
Buttttt as you can maybe see in my screenshot - even tho these two entitys wont touch each other in the level scene they still have the same hitbox values. Actually the documentation says the hitbox will be the coordinates of bounds within a 2D Space. But in my example it kinda isn't. Or maybe it is but the 2D Space isn't the same as the Level view and gameplay scene actually.
When I move my character along the hitbox aka GetGlobalBounds() won't change either. It stays with the same values all the time.
I want to show the Class Hierarchy of an Enemy or Player Entity mybe the problem lies within' polymorphy here anyhow:
If I move my Entities they manipulate the Position Property of Transformable. And If I want my sprites GlobalBounds I'll get them within Enemy or Mack. Well Actually there shouldn't be a problem or am I wrong?