Page 1 of 1

Our JS game engine

Posted: Fri Jul 20, 2012 10:14 am
by VZdemon
I've heared alot of noise and exitment revolving around HTML5 and decided to try make a game with it myself. so i started fiddling around with canvas element and it turned out some pretty owesome resaults, I even managed to run at a top speed of 60 FPS (mesured using chrome's FPS counter). any way i told myself that i'm going to furthur develop it but i just kinda got lazy and cought up with all the other things i've been doing i though you guys on the forum mite like it and may even make something nice of it. so if any1 wants the to continue the project it's up for grabs.
here's a little demo.

http://vzforumz.herobo.com/EternalQuest/

if you want to make your own map just click here

http://vzforumz.herobo.com/EternalQuest/MapEditor.html

private message me if you want the project.

*Edit: please use google chrome to view it. it also works on IE 9 but only from localhost idk why.
feedback is appreaciated

Re: Our JS game engine

Posted: Fri Jul 20, 2012 12:34 pm
by dbest
That's some decent effort there.

Re: Our JS game engine

Posted: Fri Jul 20, 2012 1:17 pm
by OldRod
Nice work! How long did it take you to get to that stage?

I'm still fine-tuning some Codeigniter stuff, but my plans are to implement a map like that in my game, so that was next on the list to research :)

Re: Our JS game engine

Posted: Fri Jul 20, 2012 5:49 pm
by hallsofvallhalla
nice work!

Re: Our JS game engine

Posted: Fri Jul 20, 2012 6:31 pm
by Jackolantern
Very cool! :)

Re: Our JS game engine

Posted: Fri Jul 20, 2012 6:39 pm
by VZdemon
Thanks, i used php and converted Rect objects to values in mysql, each map is a new table and each Rect is a value in that table. to read the map i simply retrieved the map as 1 string via php and then decoded it to an array of Rect objects.

Re: Our JS game engine

Posted: Fri Jul 20, 2012 7:19 pm
by Jackolantern
That is basically how tilemaps are often handled in game engines, where the maps will look like:

Code: Select all

[0,0,0,0,1,1,
 0,0,0,0,1,0,
 1,0,0,0,1,0,
 2,0,0,0,3,0,
 1,0,4,0,1,0,
 1,0,0,0,1,1,
 1,1,1,5,1,1]
Of course, you would usually use a map editor to form that so you aren't building that by hand (a 64x64 map could take hours to make like that by hand). You could make a simple map editor in .NET due to its simple GUI creator.

Re: Our JS game engine

Posted: Sun Jul 22, 2012 8:19 am
by VZdemon
no no thats not how my map looks like. mein looks more like this

Code: Select all

|   x   |   y   |   w   |   h   |
--------------------------------
|   0   |   0   |  100 |  20  |
| 100  |   35 |   40 |  300 |
| 240  |  657|  700|  30   |
| 45    |   35 |   40|  300 |
| 123  |   252| 410|  300 |
| 10    |   15 |   30 |  60  |
and when i retirive it, it comes as 1 string that looks like this

Code: Select all

{0,0,100,20},{100,35,40,300},{240,657,700,30},{45,35,40,300},{123,252,410,300},{10,15,30,60}
btw nice avatar

Re: Our JS game engine

Posted: Sun Jul 22, 2012 8:55 am
by Jackolantern
Haha, thank you :)

Well, that is basically the same thing. I just made up those numbers, and you can break it down and store it any way you want. Some engines may store them as JSON, some as a single array, 2D array, etc. But the important thing is making sure it is in a format you can easily modify, and hopefully a format that can easily be duplicated on other platforms in case you want to create an ecosystem of tools and editors to ease content creation.

Re: Our JS game engine

Posted: Mon Jul 23, 2012 4:17 am
by SpiritWebb
Awesome work!!