Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 24

Thread: Snake Minigame for Arcade

  1. #1
    Street Boss NJK's Avatar
    Join Date
    Mar 2014
    Location
    Mexico
    Posts
    707

    Snake Minigame for Arcade

    This is a snake game I made and It would be cool if it was added to the arcade and they would give you more tickets depending on how many balls you ate.

    Here's the code scripted and tested:
    int x= 245;
    int y= 245;

    int randomx;
    int randomy;

    color below;

    int speed=0;

    void setup(){
    size(500,500);
    drawApple();
    }

    void draw(){
    fill(235,0,0);

    if (keyCode ==40){
    below = get(x, y+26);
    y = y + speed;
    }

    if (keyCode ==37){
    x = x - speed;
    below = get(x-1, y);
    }

    if (keyCode == 38){
    y = y - speed;
    below = get (x, y-1);
    }

    if (keyCode == 39){
    x = x + speed;
    below = get(x+26,y);
    }

    if(frameCount % 1000 == 0 && speed < 10) {
    speed = speed + 1;
    }

    rect(x,y,25,25);

    if (x < 0){
    textSize(40);
    fill(#F50000);
    rect(x,y,25,25);
    text("Game Over", 170, 100);
    noLoop();
    }

    if (y < 0){
    textSize(40);
    fill(#F50000);
    rect(x,y,25,25);
    text("Game Over", 170, 100);
    noLoop();
    }

    if (x > 475){
    textSize(40);
    fill(#F50000);
    rect(x,y,25,25);
    text("Game Over", 170, 100);
    noLoop();
    }

    if (y > 475){
    textSize(40);
    fill(#F50000);
    rect(x,y,25,25);
    text("Game Over", 170, 100);
    noLoop();
    }

    println(below);

    if (below == -13369495){
    println("green");
    }
    if (below == -5373){
    println("yellow");
    drawApple();
    }
    }

    void gameOver(){
    textSize(40);
    text("Game Over Fool!", 150, 100);
    rect(x, y, 25, 25);
    noLoop();
    }

    void drawApple(){
    speed = speed + 1;
    background(255);

    fill(#FFEB03);
    stroke(#33FF69);
    randomx = int(random(20,480));
    randomy = int(random(20,480));
    ellipse(randomx, randomy, 50, 50);
    }
    Need Help?
    Shoot me a PM on Era-Go! I will gladly help you!

    Contact Me?
    Skype: santiago ornelas
    Email: [email protected]

  2. #2

  3. #3
    Big Cheese Captain
    Join Date
    Jun 2013
    Posts
    1,029
    1. Graal uses a scripting language called GS2
    2. This belongs in the arcade section
    iEra Developer / SFX Admin

    Need help? Contact me:
    Email: [email protected]

  4. #4
    Street Boss NJK's Avatar
    Join Date
    Mar 2014
    Location
    Mexico
    Posts
    707
    I worked it on Processing and it just went fine...
    Need Help?
    Shoot me a PM on Era-Go! I will gladly help you!

    Contact Me?
    Skype: santiago ornelas
    Email: [email protected]

  5. #5
    yeah, it would be nice to see it in arcade


    IGN: SashaGryg/Skype: sashagrygprovych
    Ask for help and you will receive

  6. #6
    Big Cheese Captain
    Join Date
    Jun 2013
    Posts
    1,029
    Quote Originally Posted by NJK View Post
    I worked it on Processing and it just went fine...
    Your code is not GS2. It's some other programming language Graal does not use, thus it wouldn't work.

    Not knowing much about other programming languages, I'm guessing this is C or C++
    iEra Developer / SFX Admin

    Need help? Contact me:
    Email: [email protected]

  7. #7
    Banned
    Join Date
    Jun 2013
    Location
    Singapore
    Posts
    10,403
    I'm quite certain you just copy-pasted it from the actual gaming site on how they scripted the game to work.

  8. #8
    Street Boss John's Avatar
    Join Date
    Jun 2013
    Location
    Lebanon
    Posts
    825
    Your code is made with a language called "Processing", really basic but quite fun. Also, it would be preferable if you use PHP tags.
    -Johnaudi

  9. #9
    Street Boss NJK's Avatar
    Join Date
    Mar 2014
    Location
    Mexico
    Posts
    707
    Lol XstarX... I did on my computer programming class. John is their a way you can change it too the GS2 language?
    Need Help?
    Shoot me a PM on Era-Go! I will gladly help you!

    Contact Me?
    Skype: santiago ornelas
    Email: [email protected]

  10. #10
    Big Cheese Captain
    Join Date
    Jun 2013
    Posts
    1,029
    Quote Originally Posted by NJK View Post
    Lol XstarX... I did on my computer programming class. John is their a way you can change it too the GS2 language?
    There*

    I believe the arcade uses GUI's as the windows, thus you can't convert it. You have to program it from scratch in GS2
    iEra Developer / SFX Admin

    Need help? Contact me:
    Email: [email protected]

Posting Permissions

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