Hey, this is my first post on the forum, so hi all! I'm 17 and I just started learning to program. I'm not really very good, so I started with html and the web basics (css, javascript and Jquery). Then I saw the relatively new html5 element called "canvas", mostly used for games, and I decided I could make a game in order to test my current skills. Well, I'm programming it all from scratch, avoiding the use of any framework nor library so I can really see how hard is to make a game (If i'm forced to, I'll add a library, but I'm trying to do it by myself). The game will be a simple platformer game with levels and I might make it more complex and add weapons and stuff (if I manage to finish the game first). In canvas there's no easy way to add buttons nor elements (as there is in VB), and you have to draw everything onto the screen every frame (meaning that you'll have to use several loops in order to draw everything again each frame). I haven't even started with the game levels yet but I've been creating the "core" for the game (functions for easy creating buttons, adding images, music, and such) so I can focus then on the game levels.
Here's a short list of what I've done:
-The "game" is separated with scenes, so you can change from scene to scene (for example: load scene, main menu scene, level scene...)
-Every scene has it's own "init" function(this one runs just once when the scene is loaded), "paint"(drawing things to the screen) and "act"(checking for the user's actions and acting) loops, and there are also a general "paint" and "act" loops that runs on every scene. Those are the ones that handles buttons, images, music, texts so I can easily add them in the "init" function or "act" loop of each scene.
-Every time you change scene, all the elements dissapear so I can set what I want to appear on the "init" function of the changed scene.
-I've made my custom "preload" function (I think it's very bad scripted but I wanted to try without using any preloading library), and there's a load scene that loads all the music, sound and images before starting the game.
-Sound is separated from music so you can choose to mute music and sound separately.
I'll be updating this from time to time (I'm not working a lot on this at the moment but I'll focus on it someday). And yes, I know the code can be optimized for sure (or I think so), but I've just learned how to program and this is to test myself. If anyone sees anything bad in the code and wants to help me, just do it and explain me what can I do to improve it.
UPDATE 4 September 2015
I've been adding a lots of things to the code and it seems more like a game now. You can check the last vid here:
BtqcbEl1SZ8
UPDATE 06 November 2015:
The programming part is almost done: Levels logic, shop...
OUvwti1SADA
Need to program the localStorage for saving data and create the levels.