Page 1 of 5

Frogger by GB Community & Ripper121

PostPosted: Mon Jun 23, 2014 1:50 pm
by ripper121
So the next game i like to create is frogger.
s_Frogger_1[1].png
Atari 2600 Frogger
s_Frogger_1[1].png (2.27 KiB) Viewed 6950 times


If someone like to help me, i need some graphics.
Frog, Cars, etc....


First test code with no output.
Code: Select all
//imports the SPI library (needed to communicate with Gamebuino's screen)
#include <SPI.h>
//importe the Gamebuino library
#include <Gamebuino.h>
//creates a Gamebuino object named gb
Gamebuino gb;


// Game constants
boolean paused = false;

//Game Speed
unsigned long prevTime = 0;                        // for gamedelay (ms)
int delayTime = 500;                               // Game step in ms

typedef struct
{
  char x;
  char y;
  byte w;
  byte h;
}  player;
player Frogg;

typedef struct
{
  char x;
  char y;
  byte w;
  byte h;
}  enemy;

void setup() {
  // initialize the Gamebuino object
  gb.begin();
  gb.startMenu(F("Frogger by Ripper121"));
  initGame();
}

void loop(void)
{
  if (gb.update()) {
    if (gb.buttons.pressed(BTN_C)) {
      paused = !paused; //toggle paused state
    }

    if (!paused) {

      if (gb.buttons.pressed(BTN_LEFT)) {
      }
      if (gb.buttons.pressed(BTN_RIGHT)) {
      }
      if (gb.buttons.pressed(BTN_UP)) {
      }
      if (gb.buttons.pressed(BTN_DOWN)) {
      }

      unsigned long currentTime = millis();
      if (currentTime - prevTime >= delayTime) {
        nextstep();
        prevTime = currentTime;
      }
    }
    draw();
  }
}

void initGame() {
  //Game Speed
  prevTime = 0;                        // for gamedelay (ms)
  delayTime = 200;                     // Game step in ms
  randomSeed(millis());

}



void draw() {
  gb.display.drawFastVLine(0, 0, LCDHEIGHT);
  gb.display.drawFastHLine(0, 0, LCDWIDTH);
  gb.display.drawFastVLine(LCDWIDTH-1, 0, LCDHEIGHT);
  gb.display.drawFastHLine(0, LCDHEIGHT-1, LCDWIDTH);
}

void nextstep() {}

Re: Frogger by Ripper121

PostPosted: Mon Jun 23, 2014 6:17 pm
by treflip
How do I help? I like frogger.

Re: Frogger by Ripper121

PostPosted: Mon Jun 23, 2014 6:37 pm
by treflip
Will these work? I just did them during lunch.
Image

Re: Frogger by Ripper121

PostPosted: Mon Jun 23, 2014 8:44 pm
by Drakker
Almost 16x16 is waaay too big... the screen is 48 px high. Do you plan to scroll the screen once the frog reaches the river? If so, maybe the cars could be something like 6x6 or 8x6.

Re: Frogger by Ripper121

PostPosted: Mon Jun 23, 2014 8:51 pm
by treflip
Ahh, that makes sense. I thought I read somewhere someone said 16x16 is good for sprites. I'll have to adjust it later today for 8x8 or something proportional to the road. Also I was thinking of making the automobiles white if the road will be black??? Thanks!

Re: Frogger by Ripper121

PostPosted: Mon Jun 23, 2014 9:34 pm
by ripper121
It can also 8x10 or 5x6 pixel ;).
Black is good the road is white.
Thanks for your help :)

Re: Frogger by Ripper121

PostPosted: Mon Jun 23, 2014 9:48 pm
by treflip
No problem. I need to start somewhere!

Here's the dimensions I am thinking for my parameters.
Image

The white is for measuring: Inside the grey area is 84 x 48 - so the top green is 5 pixels tall for the landing across after passing over the logs; the water is 25 pixels tall; the road is 20 pixels tall - which breaks into three lanes (6 pixels ea.) and takes about two hops per lane to get across. The cars are like Drakkar said 4 x 6.

Let me know if this is good and I'll finish up the cars/logs, spiders, tomorrow during lunch!

Re: Frogger by Ripper121

PostPosted: Mon Jun 23, 2014 10:02 pm
by ripper121
Yes looks great.
Pleas only black and white, grey is at the moment no so well

Re: Frogger by Ripper121

PostPosted: Tue Jun 24, 2014 3:13 pm
by treflip
Ok, the colored window was just to differentiate between the segments easier. Here's what it will actually look like.
Image

and here should be the images for cars, logs, flowers, alligators.
Image

Notes:
The cars move one way on the outer lanes and the opposite way in the middle.
The alligators have 4 images for moving the mouth and loop back to the first.
....The first alligator image is for when the frog needs to jump across quickly and won't kill it but the other 3 will.
The misc images on the right are flowers.
The bottom right img's are the frog. The middle blinks so the player can reference where it is quicker.


Not sure if the frog size will be an issue with the flowers let me know if it needs a little tweaking and I'll get it fixed.

Re: Frogger by Ripper121

PostPosted: Tue Jun 24, 2014 3:27 pm
by rodot
You can attach images to your post and insert them inline, so please don't host them somewhere else. Your links are broken.