Show newer

gamedev 

I've added keys, which can be used to open lockdowns that haven't been implemented yet.

Show thread

gamedev 

Fixed the segmentation fault and the death bug. Segmentation fault happened because there was an index that I forgot to set to 0. I'm used to C# where integers had the default value of 0 when declared as opposed to random values as it is in C++.

Show thread

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.

Show thread

gamedev 

I tried to test out increasing the health of the enemy, but I'm stuck with this annoying bug where the enemy dies in one hit no matter how much health I give him. I even tried giving him 1000000 hp and the result is still the same.

Show thread

gamedev 

Player can now take damage. Game Over screen is just a white screen right now.

Oh yeah, I've also fixed the bug, but I didn't feature that in this recording.

Show thread

gamedev 

The player now knocks back when colliding with the enemy. And I've encountered a bug during this recording.

Show thread

gamedev 

You can now kill the enemy. Deleting the object is so much different than what I'm used to. In C#, I could remove the object from its respective list within one of its method because it would be garbage collected. In C++ I have to delete the object outside of the object itself.

Show thread

gamedev 

The enemy now has random movement, but no collision detection.

Show thread

gamedev 

Created my first enemy. All it does is move down. It's hard-coded into the level (it's not in the level file). The octorok sprite is just a placeholder (if I even plan on releasing this).

Show thread

gamedev 

Horizontal scrolling with player movement has now been implemented.

Show thread

gamedev 

Now the camera vertically scrolls with the player's movement. Horizontal camera movement hasn't been implemented yet.

Show thread

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).

Show thread

gamedev 

Now there are three levels, all of which are derivatives of each other.

Show thread

Got a second level. I learned that if you just include a blank class definition of a dependency in the header file and then include the actual header of the dependency in the source file, then you can avoid recursive includes.

Show thread

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!

Show thread

I've added exit tiles. It just ends the game because I don't have it programmed to have multiple levels yet.

Show thread

I've added projectiles that the player can shoot. I was originally just going to make a simple maze game but I got carried away after getting a hand with SFML.

Show thread
Show older
Game Liberty Mastodon

Mainly gaming/nerd instance for people who value free speech. Everyone is welcome.