Games
When I got my first computer, I spent a lot of time gaming. So one day I had the idea that will be cooler to start designing games. After a lot of research and trying different approaches like DirectX and Allegro, I finally found a book that helped me understanding the essence of 2D games: “Foundation game design with HTML5 and JavaScript” by Rex van der Spuy. I didn’t design games but I managed to reproduce some well-known 2d games (at least at the level of concept).
Asteroids

I started reproducing this game having read the book “HTML5 animation with Javascript” – Billy Lamberta, Keith Peters.
In one chapter I found implemented the ship with the controls along with the source code and in another some reds dots( the asteroids) which randomly appeared and disappeared on the black screen. So this was my starting point.
Another useful resource was the youtube tutorial “Code Asteroids in JavaScript” by freeCodeCamp.org. From here I implemented the blinking function of the ship after collision, the circles of the impact explosion and the random rugosity of the asteroids.
Car Racing

The reproduction of this game was inspired by watching a video course “Car Racing” presented by Laurence Svekis. It is a game from my childhood, when game machines with coins where introduces to the public. I told myself that I could do it in my own way; the approach from the video tutorial was based more on html5 and css code, mine on the canvas way. The idea is that you have to race with some random generated cars. After you left behind a certain number of cars the finish line appears, so you have different times of personal records. My biggest problem: unrealistic break of the car ( it occurs suddenly ) and I couldn’t fix it because the entire natural movement of the objects was affected ( I got some weird drifting of the entire scene ). After rewatching the video tutorial I realized that I have to code everything from scratch, but I didn’t have time for that. The second problem which amazed me was the inability to emulate a sounding race car when the gas pedal is pressed. I thought to myself how difficult must be for a sound engineer which develop a game. Anyway I’m pretty pleased of the results.
Pac Man

I love maze games. Bomberman was my favorite but it was already implemented in the book “Foundation game design with HTML5 and JavaScript”. Therefore I turned to Pac Man. The idea was relatively the same but I think Pac Man is more complex. I started initially with the classical map but after some test I noticed that collision algorithm and the movement of the player which I learned so far didn’t applied to that kind of map. The walls had different thickness and some were thinner than the forwarding step of the player. So I chose a similar map to the one that Bomber Man uses. Another problem was the implementation of “A star algorithm” which applies to ghosts after they were eaten by pac man. They had to return to the starting point by choosing the shortest path, but when I tried do that they start going through the walls and then outside of the map. Therefore I decided to make them disappear and then appear in the center of the map. Another problem I haven’t solved was the regeneration of the eaten ghost: at some point there will be two ghosts of the same color. Unlike the original game when each ghost had a separate algorithm of chasing pac man mine have a randomly walk in the maze ( actually is copied paste from the book mentioned above ). And another problem: if you eat all the ghost after eating a big dot the game enters in a loop, I didn’t have time to solve this too. With all this bugs I’m still proud of my demo game!
Games
When I got my first computer, I spent a lot of time gaming. So one day I had the idea that will be cooler to start designing games. After a lot of research and trying different approaches like DirectX and Allegro, I finally found a book that helped me understanding the essence of 2D games: “Foundation game design with HTML5 and JavaScript” by Rex van der Spuy. I didn’t design games but I managed to reproduce some well-known 2d games (at least at the level of concept).

Asteroids
I started reproducing this game having read the book “HTML5 animation with Javascript” – Billy Lamberta, Keith Peters.
In one chapter I found implemented the ship with the controls along with the source code and in another some reds dots( the asteroids) which randomly appeared and disappeared on the black screen. So this was my starting point.
Another useful resource was the youtube tutorial “Code Asteroids in JavaScript” by freeCodeCamp.org. From here I implemented the blinking function of the ship after collision, the circles of the impact explosion and the random rugosity of the asteroids.
Car Racing
The reproduction of this game was inspired by watching a video course “Car Racing” presented by Laurence Svekis. It is a game from my childhood, when game machines with coins where introduces to the public. I told myself that I could do it in my own way; the approach from the video tutorial was based more on html5 and css code, mine on the canvas way. The idea is that you have to race with some random generated cars. After you left behind a certain number of cars the finish line appears, so you have different times of personal records. My biggest problem: unrealistic break of the car ( it occurs suddenly ) and I couldn’t fix it because the entire natural movement of the objects was affected ( I got some weird drifting of the entire scene ). After rewatching the video tutorial I realized that I have to code everything from scratch, but I didn’t have time for that. The second problem which amazed me was the inability to emulate a sounding race car when the gas pedal is pressed. I thought to myself how difficult must be for a sound engineer which develop a game. Anyway I’m pretty pleased of the results.


Pac Man
I love maze games. Bomberman was my favorite but it was already implemented in the book “Foundation game design with HTML5 and JavaScript”. Therefore I turned to Pac Man. The idea was relatively the same but I think Pac Man is more complex. I started initially with the classical map but after some test I noticed that collision algorithm and the movement of the player which I learned so far didn’t applied to that kind of map. The walls had different thickness and some were thinner than the forwarding step of the player. So I chose a similar map to the one that Bomber Man uses. Another problem was the implementation of “A star algorithm” which applies to ghosts after they were eaten by pac man. They had to return to the starting point by choosing the shortest path, but when I tried do that they start going through the walls and then outside of the map. Therefore I decided to make them disappear and then appear in the center of the map. Another problem I haven’t solved was the regeneration of the eaten ghost: at some point there will be two ghosts of the same color. Unlike the original game when each ghost had a separate algorithm of chasing pac man mine have a randomly walk in the maze ( actually is copied paste from the book mentioned above ). And another problem: if you eat all the ghost after eating a big dot the game enters in a loop, I didn’t have time to solve this too. With all this bugs I’m still proud of my demo game!