Tuesday, December 31, 2013

Day 8, Collision is making my head explode

I have added a PlayerObject class so I can finally move around my bar/pad (felt really good) but as soon as I implemented collision with the Playerobject it all went crazy. 
I have been debugging for hours to track down the little bugger and I have narrowed it down but I still can't seem to find the problem. 
For some reason my playerobject get an offset of 6 pixels(collision box of player compared to player position)  and runs off up on the screen even though i haven't added Y-axis movement.
The same problem exists on the code I did on my teachers platform workshop but not in the code that my teacher uploaded on the student portal from the same workshop.
So I guess I have to read some code and compare it to mine. 

Monday, December 23, 2013

Day 7, Day before Christmas

I managed to get a little work done. I made a basic level class that is used to draw the level in the GameState. I played around with sprites as well and added fullscreen as soon as you enter the gamestate.
Here is a screen of what we got so far.


It's nice to get a visual of all the code done so far. Sure it's not a game yet but it's a start.
Now its time for some glögg and Christmas celebrations with my family.

Friday, December 20, 2013

Day 6

I have now made an InputManager and a GameObject Manager, I'm not sure I have constructed and implemented them the right way but it kind of works right now. I have also played around with the States. Its hard to understand what goes where, for example. where do I put UpdateEvents? Should that go in the Engine class or should i write an UpdateEvent method for each GameState? Right now I put it in the InputManager in a method called UpdateInputs, This method is called in each state.
I think i will put it in each State instead. for example:
 The MenuState might only take mouse events while the Gamestate is played with keyboard. loading screens or game over screens dont take any event at all except maybe quit by X in the window.

I have also started with the collider class and next i will work on drawing the gamestate.
I'm not sure how i will go about it.  I feel that i want to draw the background first and the actual boxes you shoot down should be drawn after the background. Since i want to be able to change levels.

or maybe I will just load everything after each level when changing states.

I guess learning programming is a lot of trial and error.

Tuesday, December 17, 2013

Day 5

I stayed home this morning to work on the project alone. I managed to understand the use of states and I made the frame for a virtual State class. I also made a MenuState class, GameState class and a StateManager class keeping track of it all. It felt good when i figured out how to implement it all. I'm not sure I'm doing it "the right way" but it works in its basic form but the classes still need much work.
The way i see it the code we make will be put in the different states gradually over time.

The morning felt great but in class this afternoon i got slapped in the face again with a dynamic way of creating animations of sprites.

Sure I have managed to animate and move a sprite before but in simple non dynamic way. right now I feel that i won't touch animation until we got some basic things in our project finished.

Monday, December 16, 2013

Day 4

Me and Stefan met after class to do some work. He had apparently done the vector class, input class and a pong version of a ball class already. The ball class might need some work to fit with the GameObjects class but its a start.

Today at class we learned about Inheritance, Polymorphism and how to handle different States using a StateManager. e.g. game states or AI-states. So that messed up a lot of how the program structure is built and I think its good if we rework all that we got so far and adapt that to what we just learned.

Since Stefan is doing classes on the side we thought best he started with music and sound classes and managers to both those classes.

We had apparently missed that the GameObject class needed a Manager class, same with the input class so that needs to be added as well. I think I will start with a StateManager class and then implementing everything after that.

The Project plan needs to be updated as well. its far from a real project plan. we will probably start look more deeper into how to actually build the game when some of the basic structure is in place.

Sunday, December 15, 2013

Day 3

I was supposed to meet Stefan today for some group work but he said he would come later then agreed upon so i chose to work from home instead of waiting for him at school. I added some classes to the project. I added a Gameobject class and I also added the vector class since it's needed for the coming classes that needs to be built. Stefan was supposed to build that but since I haven't heard from him on how its going i decided to do it.

So far we got Sprite, Spritemanager, Drawmanager, Gameobject and  a Vector classes. Next im thinking of working with a collider class, first only box vs box collision to get it to work. I will try to add other collision types later.

I hope Stefan will deliver the input class soon so i can use it for testing the movement. I will tell Stefan to start working on either player or a ball class as well now.

We have class tomorrow so I will hopefully get a chance to talk to him then.


Thursday, December 12, 2013

Day 2

We made a first version of the project plan as posted below and we started programming some. Me on the basic classes needed to load a sprite and Stefan on an input class to handle input from keyboard and mouse.

It felt good to get some plans down on paper even though they are far from complete. We will probably keep the plans dynamic because we don't know what we will be able to implement. Some things might be scratched and more things might get added, time will tell.

Since we both will be apart during the holidays 18 December to January 5th we will have to come up with a good way to communicate and divide work and share work online or using programs like Dropbox until we meet again.

Project Plan

Project Plan
Project members: Georgios Chatzoglakis & Stefan Somo.
Goal: Make an Arkanoid clone before the end of the course using C++ and SDL:

Georgios is in charge of putting the parts of the program together while Stefan is in charge of creating classes that can be implemented into the main program. The aim is to implement all the basic features first to get a working prototype as fast as possible and with time left add more content to the game.

Week 1: (starting December 11th)
Build the base of the following classes.
Engine class
Drawmanager class
SpriteManager class
Sprite class
InputManager class
Vector class
GameObject class
PlayerObject class.
Week 2: (until 22th of December)
Build and add the following classes and try to get some basic game elements working like the player and the ball with some easier collision.
Boll Class.
Collider Class
Enemy object class
Week 3: (22th – 27th)
Holliday break for a few days.

Week 4: (27th December – January 2nd)
Improve the gameplay and collision. Add the following classes.
File handling class
Animation class
Sound class

Week 5:  (3rd January – 10th of January)
Polish and improve the game
If time permits, Start working on Visual effects, Vector effects on the ball.
Add a GUI, Enemies with some kind of AI.

Last Week: (11th January to 18th?...date not set )
Polish, game testing and bug squashing.

Work divided so far:

Georgios work on the Engine, Drawmanager, SpriteManager and Sprite class
Stefan starts with the Input Manager class and later move on to the Vector class.

Decisions made
Plan is to make the basics of the game work first and then add more elements after the basic stuff like moving and drawing sprites are done.
The border of the game space will probably be hardcoded into the game to begin with to avoid strange collision behaviors.
The gameobject class will have a few subclasses (all not decided yet) put will probably include
Playerobject, ball, Tile/obstacle, Enemy object, drop Items, score/highscore, and a class to handle the graphical user interface

Collision/collider class,
We will start with box vs box collision and then move to box vs circle if we can manage it.
Circle vs circle and perfect pixel is a secondary task and will be implemented if solution is figured out.

Sound class will include sound and music manager.

A filehandling class will be added and improved during the project. First to load a level map from file and then if solution found it might be used to save and load highscore to file

Animation class will be added to handle animation of enemy objects if time permits.

Visual effects of some sort, AI on enemies, a GUI class, a text class and a more advanced vector class will be worked on if time permits



Some kind of start screen and end screen will be added as well after lecture about game states.

Wednesday, December 11, 2013

Day 1, My first game on the way!

Today I met with my groupmate Stefan for our final assignment in the course Game programming 1. We have to construct a game using C++ and SDL graphic library in about 5 weeks. Its scored depending on different elements included in the game such as animation, collision, visual effects etc.

We didn't have much time for our first meeting so we tried to think of a game we want to make and are able to make in such a short time and its leaning towards an Arkanoid clone.

We will hopefully have time to set up the project and lay a plan for future weeks at the meeting tomorrow.
We will have to come up with a way to work apart since we wont meet during the Christmas & New year holidays.