Not the breakout clone but I've got animated sprites to work in SFML.
Also, I forgot that I have the #gamedev hashtag featured in my profile and I haven't used it, so here you go.
So it turns out that I can't have multiple levels without major reconstruction of the code. C# spoiled me with it's lack of import/include statements and Python was dynamically typed which meant I didn't have to declare the object type right away, so now I have to deal with avoiding recursive includes.
Ugh!
gamedev
gamedev
I've fixed the bug, but now the enemy is left on the death animation if it dies. As you can see, the enemy is knocked back based on the direction it is facing, when it should be based on the velocity of the projectile (result of copying and pasting code from player's knockback).
There is also a new problem in that I keep on getting segmentation faults. I don't know where they are coming from.
gamedev
Enemies are no longer hard coded into the map. They are now loaded from the map file. Ignore the enemy placement. It moved before I could take the screenshot. (My screenshot utility is probably delayed)
The first two numbers defined the level width and height.
The block of numbers are the tiles.
Everything after that are objects. They are listed by object type and then the x and y coordinates.
gamedev
Door now has a sound effect.
I've also realized that the way I'm storing assets in RAM is inefficient (I've actually knew that since the beginning but I haven't bothered to fixed it). I need to implement an asset manager class and have each object store pointers to said assets. Right now, each object stores entire textures/sounds when they should be storing pointers instead.
gamedev
gamedev
@ne Changed that just now. Thanks for the tip. This kind of stuff was much easier in MonoGame because C# had built in getters and setters. C++ on the other hand, makes it a bit more cumbersome.
gamedev
@ne I also shaved off some pixels from the hitbox horizontally. I've noticed that Link's Awakening has smaller hitboxes than the sprites. It makes it much easier to fit the characters in 1 tile long corridors.
re: gamedev
re: gamedev
re: gamedev
@Binkle I've made it so that the bullet is deleted after the collision. I've also made it so that the enemy would be in a knocked back state on collision if they still have hp and the enemy can't take anymore damage while still in the knocked back state.
I honestly don't know what's wrong.
gamedev
Horizontal scrolling with player movement has now been implemented.
#gamedev #SFML