Thread: applet game

    #1
  1. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2002
    Posts
    254
    Rep Power
    13

    applet game


    Hi, I am trying to make an applet game called snake. You know the snake game it easts and gets bigger. I have some problems with snake's movments.

    if anyone of done the game and are willing to share your code it would be very greateful.

    thanks
    Thank you for any help.
  2. #2
  3. SwollenMember
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Location
    the master control
    Posts
    264
    Rep Power
    15
    maybe you could specify your exact problem with it's movements...you might not need to look at someone elses code.
  4. #3
  5. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2002
    Posts
    254
    Rep Power
    13
    you're right I figured out myself thanks anyways
    Thank you for any help.
  6. #4
  7. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2002
    Posts
    254
    Rep Power
    13
    but I have another problem now

    I have made some classes which are used by the main applet
    which have Image in them

    Code:
    public Image img; 
    img = Toolkit.getDefaultToolkit ().getImage ("C:/WINDOWS/Desktop/c++/java/project/peace.gif");
    when I run the applet in html page it gives an error
    exception.com.ms.security.SecurityExceptionEx[Apple.<init>]: cannot access file peace.gif
    Anyone know why and how it could be fixed?
    P.S.
    (ALL FILES EXIST IN THE SAME FOLDER AND THE APPLET RUNS FINE IN "JAVA EDITOR")
    Thank you for any help.
  8. #5
  9. SwollenMember
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Location
    the master control
    Posts
    264
    Rep Power
    15
    img = Toolkit.getDefaultToolkit ().getImage ("C:/WINDOWS/Desktop/c++/java/project/peace.gif");

    doesnt it need to be C:\WINDOWS\.....
    also, it has been a while since i used java, but i know with C++ you need '\\' instead of '\'
  10. #6
  11. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2002
    Posts
    0
    Rep Power
    0
    The problem is your game is applet. And it has NO access to any files on local mashine. Imagine any applet stealing any file from your computer - nonsence ! The only place applet has access is the host it was downloaded from, so try donloading your image instead of direct file access.

IMN logo majestic logo threadwatch logo seochat tools logo