I've been gaining some valuable Javascript experience with some recent unrelated projects and knocked up a pretty nice Javascript Engine
http://www.bloo.us/javascript/tileengine/
Lets see how far it gets. I'm going to make this engine Open Source.
« previous next » |
New Javascript Engine (Read 75998 times)

#3


Posts: 230
Logged
This thing works great even with layers. I added a character layer on top, with a number of characters on it. It's starting to look like a Shining Force engine.
Pairing this up with a reverse Ajax approach will definitely make a nice multiplayer engine.
Pairing this up with a reverse Ajax approach will definitely make a nice multiplayer engine.

#4
Administrator
Shining Spammer

Posts: 1,129
Logged
Loving it Job.
Keep the good work up.
Let me know if you need a tester
my alias @ hotmail for msn.
Keep the good work up.
Let me know if you need a tester

my alias @ hotmail for msn.
~Elvenfyre

#5


Posts: 230
Logged
I actually found a way to implement smooth scrolling. I was never able to do this with flash. I'm still debugging though.
http://www.bloo.us/javascript/tileengine/
http://www.bloo.us/javascript/tileengine/

#6
Administrator
Shining Spammer

Posts: 1,129
Logged
OK a couple of bugs I came up with. Firefox 2.0.0.1
Perhaps you should shift the screen when the char is one more square away from the edge?
Because when moving the screen up or left, the char disappears when you've just moved the screen - until you press a key then he reappears.
When moving the screen(mainly right or down, but on the odd occasion left) a second "hero" appears(he goes away when you press another key too).
Also at one point when i did cause this second hero to appear on walking left, the obstacles on the screen had been misplaced by one square(the obstacles were 1 higher than the bush graphics) - and the mirror image hero didn't go away.
I'm getting 0 cpu useage when leaving it running with the dudes moving round etc, and up to 87% useage when I move.
Athlon 2500, 1.25GB ram, nVidia 6600GT
Perhaps you should shift the screen when the char is one more square away from the edge?
Because when moving the screen up or left, the char disappears when you've just moved the screen - until you press a key then he reappears.
When moving the screen(mainly right or down, but on the odd occasion left) a second "hero" appears(he goes away when you press another key too).
Also at one point when i did cause this second hero to appear on walking left, the obstacles on the screen had been misplaced by one square(the obstacles were 1 higher than the bush graphics) - and the mirror image hero didn't go away.
I'm getting 0 cpu useage when leaving it running with the dudes moving round etc, and up to 87% useage when I move.
Athlon 2500, 1.25GB ram, nVidia 6600GT
~Elvenfyre

#7


Posts: 38
Logged
This looks really cool! I'm getting the same results as Elvenfyre though, with the duplicate (and somtimes triple) hero and a jump in the animation when it starts. Also, the buttons (up,down,left,right) don't do anything for me though. I tried it in Firefox 1.5 and IE 6.

#8


Posts: 230
Logged
Thanks for the bugs reports guys, i'm aware of most of these issues, i hope i can improve performance a little on the scrolling.

#9
Administrator
Shining Spammer

Posts: 1,129
Logged
Perhaps the smooth scrolling is causing more problems than its worth?
~Elvenfyre

#10
Administrator
Shining Spammer


Posts: 1,208
Logged
That looks pretty cool.
It indeed looks like the scrolling could use some optimization. Perhaps you can post that piece of the code here and we can take a look at it?
It indeed looks like the scrolling could use some optimization. Perhaps you can post that piece of the code here and we can take a look at it?


#11


Posts: 230
Logged
I finally got some time to work on this thing and fixed plenty of issues. I managed to keep smooth scrolling while maintaining fairly good performance.
Dev, if you want to look at the code check TileEngine.js in your Temporary internet files. The smooth scrolling makes the code a little more complex and it needs a little staring at.
Basically i use a table of 16*10 cells, with 48*48 sized tiles. For smooth scrolling, we need to move Bowie from cell A to adjacent cell B, progressively rather than at once.
I actually move the contents of cell A by x pixels and the contents of cell B by -x pixels in intervals (using setTimeout), and yes i'm surprised this works at all.
Dev, if you want to look at the code check TileEngine.js in your Temporary internet files. The smooth scrolling makes the code a little more complex and it needs a little staring at.
Basically i use a table of 16*10 cells, with 48*48 sized tiles. For smooth scrolling, we need to move Bowie from cell A to adjacent cell B, progressively rather than at once.
I actually move the contents of cell A by x pixels and the contents of cell B by -x pixels in intervals (using setTimeout), and yes i'm surprised this works at all.
