Jump to content

Showoff My HTML5 game


Peaverin

Recommended Posts

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.

Link to comment
Share on other sites

Welcome to the site Peaverin!

The game looks like it is off to a great start and your explanation of the HTML5 Canvas rendering was spot on.

The use of requestAnimationFrame is great and your rendered buttons work well. Keep it up and keep us informed on your progress!

-JC

Link to comment
Share on other sites

  • 2 months later...
  • 5 weeks later...

It's been a long time since I don't update this. I did a lot of things to the game and started programming the levels logic. Here's a video that shows what is done at the moment. I'll update the main topic explaining what's new when I have time. By now you can watch this video of the game. It was recorded with an annoying screen recorder because Camtasia Studio wasn't working and I had to use that other program:

e-0dvwfFmUw

Link to comment
Share on other sites

  • 1 month later...

Hey! Lately I've been working on my game, and there's been some progress. There's a video demonstration of what's been added until now.

I've already created a map editor that generates the code of the map you create. You can also edit an existing map and you can edit everything: blocks (there 4 layers: the first one is for blocks behind the character and the second one for blocks that block the character; the third and fourth ones are for blocks before the character), song, tileset, background... I also added items and hud for hp and money.

The next now is adding weapons and enemies. Here's a little video demonstration of an example map. I might upload a video showing the map editor in the future.

BtqcbEl1SZ8

By the way, if anybody is interested in helping with graphics (mainly for the UI,hud and items), please PM me. Any help will be appreciated. Also I tried this game in my mobile devices as well as Ipad and it works properly. There are still some problems with the multitouch and such things, but with a little twerk of the code it can be fixed easily. Anyways I want to focus on the PC navigator game firstly so I can transform it into a mobile game later. I can give some tips for HTML5 game programming in anywant wants to.

Link to comment
Share on other sites

Thanks! Actually graphics are my main issue because I have 0 knowledge on making graphics and I took them from freeopenresources. I know the GUI and the tiles and items have not the same style but they are good for testing.

Link to comment
Share on other sites

  • 1 month later...

Looks good man! Nice to see you improving so fast. I wish I had your perseverance!

Thanks! Actually this game is being part of a final high school project so I have an excuse to be perseverant.

Looks pretty beast, is this single player only or are there plans to make it multiplayer?

Thank you! At the moment I'm focusing in single player game. It will be launched both for navigator and for Play Store.

I sometimes think about making a multiplayer version someday but it will be too much time consuming and I'll have to learn loads of things (I've been learning something about node.js along with sockets.io but I'm still very newbie with all of this). So I'll first finish the offline version and then I might create the multiplayer one.

Link to comment
Share on other sites

  • 3 months later...

Hi all! I'm happy to announce my game is finished.

www.peaverin.com

Maybe the difficult is a little high, idk. Just test it! I don't want to win any money or visits in the page with the game, just feedback and the satisfaction of having programmed and created a game almost 100% by myself (except the resources part, although I had hard times editing with Gimp).

Hope you like it ^^

Link to comment
Share on other sites

I love it, it is pretty hard but I find it really fun. This has come very far since I saw it first.Β  I think it is really funny that I will often hit some spikes which will toss me into an abyss or another set of spikes. The game is very smooth though, I love the physics and all the different elements you added, enemies, horizontal and vertical platforms, etc :D

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...