🔒 Locked
Javascript can be fun! Part Trois...
Advertisement
Original Post
Writing simple games in javascript has always been a fetish of mine. The last one I actualy decided to tell you guys about was my tetris clone. Anyway, to make a long story short: I was bored today. So I decided to sit down and write a Snake Clone in javascript. It's something I've done before but I lost the files from my last time. I'm not that fond of the result as of this time - my last version had up to four players and levels. But in this one the graphics are more than just squares. (My paint skills rules!) Suggest a feature, report a bug and comment all you want: <a href="http://www.humblesiden.dk/kasper/snake.html">Clicky</a>
Fast, but very cool [wink]
Still, I have to repost my own JS skillz...
Still, I have to repost my own JS skillz...
I open the page to get a frame and some buttons. I click start and a flowery thing appears and 99% of the time it then says 'Game Over'. The other 1% of the time it displays some snake segments (and once ina while a head) and nothing happens[ie it doesn't move, arrow keys etc don't have any effect].
??
Hrmm, I guess it moves too fast, but it never displays the snake at all until several seconds after I've died (by which time I was clicking start again).
??
Hrmm, I guess it moves too fast, but it never displays the snake at all until several seconds after I've died (by which time I was clicking start again).
Quote:
Original post by Extrarius
I open the page to get a frame and some buttons. I click start and a flowery thing appears and 99% of the time it then says 'Game Over'. The other 1% of the time it displays some snake segments (and once ina while a head) and nothing happens[ie it doesn't move, arrow keys etc don't have any effect].
??
Weird. Are you on a very slow connection? (Maybe the pictures didn't load before you started?) And what browser?
Uh, and if it's too fast, you should choose a lower skill level [wink]
I'm using IE on a 3Mb connection, so the pictures shouldn't be taking any time at all to load (unless they're 1600*1200*32 bit color bitmaps shrunk down using size attribs or something like that)
Setting on a lower skill (1-3) makes it playable, but it really looks bad because the images take forever to show up and then they update very slowly so for ex it looks like there are 2 head segments 99% of the time, and often there will be a disconnected tail segment that is 2-3 'tiles' behind the snake that moves as part of the snake (like there are 2-3 invisible segments or something)
Setting on a lower skill (1-3) makes it playable, but it really looks bad because the images take forever to show up and then they update very slowly so for ex it looks like there are 2 head segments 99% of the time, and often there will be a disconnected tail segment that is 2-3 'tiles' behind the snake that moves as part of the snake (like there are 2-3 invisible segments or something)
Quote:
Original post by benryves
Fast, but very cool [wink]
Still, I have to repost my own JS skillz...
Thats really cool. id never be able to do something like that.
Quote:
Original post by Extrarius
It seems like every time an image changes, the images is redownloaded (which takes a small fraction of a sec from overhead). In your tetris game, as soon as I click start, IE starts downloading 300+ items, and it seems to constantly be downloading while snake is going
That's extremely weird, what version of IE are you using?
I'm using the latest version of IE on WinXP Pro w/ SP2
Edit: Fix it. Had to change "Check for newer versions of stored pages" from "Every visit to the page" to "Automatically". Not sure why, because its never caused problems with anything else. It'd be great if you could find a way around that because the auto setting doesn't work very well IME.
Edit: Fix it. Had to change "Check for newer versions of stored pages" from "Every visit to the page" to "Automatically". Not sure why, because its never caused problems with anything else. It'd be great if you could find a way around that because the auto setting doesn't work very well IME.
Bug!
When you get your snake equal length to itself, so that it looks like this:
Where "h" is the head and "t" is the tail, and you press "down," you die. However, you shouldn't die, because by the time your head gets there, your tail should have moved into the next spot, right? :)
Very nice though!
When you get your snake equal length to itself, so that it looks like this:
hoooootoooooWhere "h" is the head and "t" is the tail, and you press "down," you die. However, you shouldn't die, because by the time your head gets there, your tail should have moved into the next spot, right? :)
Very nice though!
Quote:
Original post by Extrarius
It is fixed, but only when I set to auto as I said (I tested setting it back to see if it was preloading that fixed it and it was not).
Ok, it now actualy uses the preloaded images when it updates an image. Try one last time, if it doens't work now, I don't know how to make it work.. [sad]
Quote:
Original post by benryves
Fast, but very cool [wink]
Still, I have to repost my own JS skillz...
Wow! And to think I wasted years learning useless things like C++. javascript is clearly the way of the future!
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement