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
Got a camera to work. It's manual but if I plan to actually finish this game, I would probably have it scroll based on the player's position and movement. You can also see that there are tiles outside of the camera bounds. Those were left in by mistake.
SFML has a built in camera called sf::View. It's pretty weird. I'm used to having a 2D camera origin being at the top-left corner just like sprites, but the origin is actually in the center which is something I need to get used to.
I mean, it's kind of justified because it also has support for rotation and zooming (things I have never used). I'm just used to implementing my own camera system and just drawing sprites based off of their positions and the camera offsets, but that not an option here because sprites are automatically drawn based on their position (no manually drawing here).
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
Replaced the wood tiles with charcoal colored ones. Wood didn't look good mixed with the metal-like walls.
I've also changed the tile format for the levels. 1st digit is the tile type, while the 2nd digit is the tile that appears on screen. It broke compatibility with my level files, obviously, but it's worth it because now the tile maps are readable.
Also, the first level you see in this video was just some sample output generated from a procedural generated cave algorithm on the roguebasin wiki. I just converted it to my level format. It kind of looks without a cave tileset though.
@offset Thanks. I don't know if I intend on publishing it though. It's just me practicing object management. Previously, I used C# and MonoGame. C# is garbage collected, so I'm not really used to pointers and memory management.
re: gamedev
re: gamedev
@coolboymew It was supposed to be just a simple maze game. I recently switched to C++ and SFML so I'm trying to get used to how they handle objects and everything, but I ended up getting carried away after getting used to the quirks, and now it's some dungeon crawling, top-down shooter.
I've never played Chip's Challenge. That game was before my time. I've seen footage of it. Looks like some sort of roguelike.
re: gamedev
re: gamedev
@coolboymew After seeing this video, I think I played a clone of this game. I had the PC version of Spongebob: Battle For The Bikini Bottom as a kid. It was nothing like the console versions and instead just a collection of minigames. One of the minigames involved navigating through the Chum Bucket in levels like this. It wasn't tile based though.
re: gamedev
@lunarfox Fuck off, schizo.
gamedev
Player position is now defined in the map file. The second line of numbers determines the player's x and y position (in tiles).
#gamedev #SFML