Author Archives: Niklas Svantesson

Game Development and Coding 20 Feb 2014 – Player Sprite Animation

Courtesy of Nils Wennergren
Animated Sprites with C++ and SFML.
It’s always helpful to see a representation of your avatar on the screen in the form of a sprite. But just having a sprite on the players location is not always enough. You’ll probably want it to be animated in some way. It seems a bit more alive then. This of course applies to a lot more objects in the game than just the player, though maybe not every single […]

/ Comments Off on Game Development and Coding 20 Feb 2014 – Player Sprite Animation
Program: Programming

Game Development and Coding 20 Feb 2014 – Player Sprite Animation

Courtesy of Nils Wennergren
Animated Sprites with C++ and SFML.
It’s always helpful to see a representation of your avatar on the screen in the form of a sprite. But just having a sprite on the players location is not always enough. You’ll probably want it to be animated in some way. It seems a bit more alive then. This of course applies to a lot more objects in the game than just the player, though maybe not every single […]

/ Comments Off on Game Development and Coding 20 Feb 2014 – Player Sprite Animation
Program: Programming

Game Development and Coding 13 Feb 2014 – Collider class

The Collider Class.
Last week I worked on the collider class. Mostly I worked on the class’ overlap methods. Each object in the game that’s capable of colliding with something has its own collider as a member.
It is the Collider that determines the actual position of the object it is a member of.
The Collider has a position in the form of a pair of coordinates on the x-axis and the y-axis. The Collider also has a pair of values that determines […]

/ Comments Off on Game Development and Coding 13 Feb 2014 – Collider class
Program: Programming

Game Development and Coding 13 Feb 2014 – Collider class

The Collider Class.
Last week I worked on the collider class. Mostly I worked on the class’ overlap methods. Each object in the game that’s capable of colliding with something has its own collider as a member.
It is the Collider that determines the actual position of the object it is a member of.
The Collider has a position in the form of a pair of coordinates on the x-axis and the y-axis. The Collider also has a pair of values that determines […]

/ Comments Off on Game Development and Coding 13 Feb 2014 – Collider class
Program: Programming

Game Developement and Coding

This week we had our first scrum sprint, meaning we set up assignments for each group member to be done with by Friday. The assignments were either art, music or code to be used in the game we are making, Dangerous Dander.
Being a coder my assignments were to start on the different classes of our game objects as well as their inheritance structure. That basically means I had to make so called Parent classes from which other classes will inherit […]

/ Comments Off on Game Developement and Coding
Program: Programming

Game Developement and Coding

This week we had our first scrum sprint, meaning we set up assignments for each group member to be done with by Friday. The assignments were either art, music or code to be used in the game we are making, Dangerous Dander.
Being a coder my assignments were to start on the different classes of our game objects as well as their inheritance structure. That basically means I had to make so called Parent classes from which other classes will inherit […]

/ Comments Off on Game Developement and Coding
Program: Programming

Game Programming I – Assignment day 25

Finished work on the code today and handed in the project.
The final work mostly consisted of making sure all cleanup functions did what they were supposed so that everything that needs to be deleted really is.
This should take care of memory leaks.
Also started writing the report.
Will finish it later today an upload it as well.

/ Comments Off on Game Programming I – Assignment day 25
Program: Programming

Game Programming I – Assignment day 25

Finished work on the code today and handed in the project.
The final work mostly consisted of making sure all cleanup functions did what they were supposed so that everything that needs to be deleted really is.
This should take care of memory leaks.
Also started writing the report.
Will finish it later today an upload it as well.

/ Comments Off on Game Programming I – Assignment day 25
Program: Programming

Game Programming I – Assingment day 24

Worked more on the overlap function today.
box vs box and circle vs circle collisions now work better.
Added an enemy class called FoeLarge.
The FoeLarge is spawned at the middle of the x-line of coordinates no matter what resolution you set the game to.
The new enemy takes damage from bullets but not from the player.
The player collides with the large enemy but takes no damage.
Added victory and defeat conditions.
Helped a little with the options state.
 

/ Comments Off on Game Programming I – Assingment day 24
Program: Programming

Game Programming I – Assingment day 24

Worked more on the overlap function today.
box vs box and circle vs circle collisions now work better.
Added an enemy class called FoeLarge.
The FoeLarge is spawned at the middle of the x-line of coordinates no matter what resolution you set the game to.
The new enemy takes damage from bullets but not from the player.
The player collides with the large enemy but takes no damage.
Added victory and defeat conditions.
Helped a little with the options state.
 

/ Comments Off on Game Programming I – Assingment day 24
Program: Programming

Game Programming I – Assignment day 23

More work on collision detection today.
The collision manager now checks overlaps between objects.
If there is one it returns a pair to the first object containing a pointer to the second object and the offset.
Now I will need to work on collision handling in the different classes.
They will decide what happens when a collision with a certain object occurs.

/ Comments Off on Game Programming I – Assignment day 23
Program: Programming

Game Programming I – Assignment day 23

More work on collision detection today.
The collision manager now checks overlaps between objects.
If there is one it returns a pair to the first object containing a pointer to the second object and the offset.
Now I will need to work on collision handling in the different classes.
They will decide what happens when a collision with a certain object occurs.

/ Comments Off on Game Programming I – Assignment day 23
Program: Programming

Game Programming – Assignment day 22

More work on collision today.
Added HP to the parent class Entity, as well as methods that changed or displayed the hp.
Added if statements to change the HP on objects that collided.
Put the Foe object in a vector to make the code able to handle several objects of the foe class.
Added a HP check to the game loop that checks HP and deletes the objects that have no HP left, or rather HP zero.
Going to work some more on this later, […]

/ Comments Off on Game Programming – Assignment day 22
Program: Programming

Game Programming – Assignment day 22

More work on collision today.
Added HP to the parent class Entity, as well as methods that changed or displayed the hp.
Added if statements to change the HP on objects that collided.
Put the Foe object in a vector to make the code able to handle several objects of the foe class.
Added a HP check to the game loop that checks HP and deletes the objects that have no HP left, or rather HP zero.
Going to work some more on this later, […]

/ Comments Off on Game Programming – Assignment day 22
Program: Programming

Game Programming I – Assignment day 21

More work on collision.
Moved overlap method to collider class, it checks box vs box collision.
Also made a overlap circle method that checks overlap between two circles.
Need to add the collision manager into this and make things happen when collision occurs rather than just a cout line.
I should also make an Entity manager that handles all the game objects.

/ Comments Off on Game Programming I – Assignment day 21
Program: Programming

Game Programming I – Assignment day 21

More work on collision.
Moved overlap method to collider class, it checks box vs box collision.
Also made a overlap circle method that checks overlap between two circles.
Need to add the collision manager into this and make things happen when collision occurs rather than just a cout line.
I should also make an Entity manager that handles all the game objects.

/ Comments Off on Game Programming I – Assignment day 21
Program: Programming

Game Programming I – day 20

Overhauled the collision manager.
Colliders are now memebers of their objects.
Need to fix the overlap function in the collider class.
But first I need some sleep.

/ Comments Off on Game Programming I – day 20
Program: Programming

Game Programming I – day 20

Overhauled the collision manager.
Colliders are now memebers of their objects.
Need to fix the overlap function in the collider class.
But first I need some sleep.

/ Comments Off on Game Programming I – day 20
Program: Programming

Game Programming I – Assignment day 19

Today I corrected the collision manager.
I removed the vector colliderID because it was unnecessary and unreliable.
I have made a foe class to keep track on enemy objects by giving them their own extension values rather than 0.0 which they would have as entities.
I started working on a checkcollision method for the collsion manager.
It now goes through the collider vector and checks if any overlap.
I need to know which colliders overlap however so I might have to redo it as I […]

/ Comments Off on Game Programming I – Assignment day 19
Program: Programming

Game Programming I – Assignment day 19

Today I corrected the collision manager.
I removed the vector colliderID because it was unnecessary and unreliable.
I have made a foe class to keep track on enemy objects by giving them their own extension values rather than 0.0 which they would have as entities.
I started working on a checkcollision method for the collsion manager.
It now goes through the collider vector and checks if any overlap.
I need to know which colliders overlap however so I might have to redo it as I […]

/ Comments Off on Game Programming I – Assignment day 19
Program: Programming

Game Programming I – Assingment day 18

Bullets now have a life of 100 frames.
After that they get removed from the bullet vector.
Also added a limit on how many bullet objects can exist at the same time.
Also made a second vector for the Collision Manager that stores the id of the collider.
Needed to add a string option for Entity class which is the name of the object.

/ Comments Off on Game Programming I – Assingment day 18
Program: Programming

Game Programming I – Assingment day 18

Bullets now have a life of 100 frames.
After that they get removed from the bullet vector.
Also added a limit on how many bullet objects can exist at the same time.
Also made a second vector for the Collision Manager that stores the id of the collider.
Needed to add a string option for Entity class which is the name of the object.

/ Comments Off on Game Programming I – Assingment day 18
Program: Programming

Game Programming – Assignment day 17

Continued working on collsion manager today.
I seemed to have managed to make the manager create colliders for game objects and save them in a vector.
I also managed to write out the collider position (x and y coordinates) while the game was running as well as writing out a message when the two positions were identical.
One step closer to proper collision detection.

/ Comments Off on Game Programming – Assignment day 17
Program: Programming

Game Programming – Assignment day 17

Continued working on collsion manager today.
I seemed to have managed to make the manager create colliders for game objects and save them in a vector.
I also managed to write out the collider position (x and y coordinates) while the game was running as well as writing out a message when the two positions were identical.
One step closer to proper collision detection.

/ Comments Off on Game Programming – Assignment day 17
Program: Programming