Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Sep 2003
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Question on Jscript games and images

    Right now I'm working on a javascript snake game (http://www.zuban.tk) and i've found that it runs slowly and chopily on slower computers. Currently im creating a layer for each image using the <div> tag. I think that is ineffeciant and is why the game runs slowly. This is my first Jscript game so I'm unfamiliar with the standerds. I've looked at a few sample game scripts but can't seem to find a way to effeciently do graphics without layers. I'm probably just overlooking something simple.
    Thanks for your help
    Alex

  • #2
    Senior Coder Spudhead's Avatar
    Join Date
    Jun 2002
    Location
    London, UK
    Posts
    1,856
    Thanks
    8
    Thanked 110 Times in 109 Posts
    Nothing really constructive to add I'm afraid except that it ran fine on my 2Ghz p4 and that I found it excellently playable - the rotation-steering method adds a whole level of difficulty...

  • #3
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    Yeah, you are just stuck with the speeds....that is why all gaming systems require a certain procesor......

    Nice game.

    Only thing you might look into is not using images or divs and using a table, but it will look worse then what you have. I would stick with what you got.

  • #4
    New to the CF scene
    Join Date
    Sep 2003
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks, i just thought that since my graphing calculator can run snake without a problem then surely a p3 should have no problem. It runs fine on my computer but i have a p4 2.4 gHz.

  • #5
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Increase the quantisation of the animation - run half as many iterations but move twice the distance; it may look jerkier, but you'll get better performance.

    The balance between iterations and movement is very important - I'd recommend experimenting with a few different ratios on a few different computers, to find the optimal.

    Nice game btw - more interesting than the usual snake
    "Why bother with accessibility? ... Because deep down you know that the web is attractive to people who aren't exactly like you." - Joe Clark


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •