Unofficial Game Jam 4: Ends 12:00 UTC+00:00


(Pharap) #81

Anyone made any progress?


#82

I was just about to ask if anyone had teasers.

I’ve rewritten everything I had before and am down to 47% ram usage :+1: No thanks to PROGMEM shenanigans. Also @Pharap the static cast to char is needed.

Now I just have to make the game.


(Holmes) #83

I think I have things planned out for my game. Fonna spend all Sunday getting it taken care of. :grinning:


(Simon) #84

@vampirics and my game is coming along nicely. Although I love the graphics that Stephane has put together, the size of them is killing me!

Actually write the game, that’s foolish talk!


(Stephane C) #85

I would have optimized them more if I had more time to do it… :wink:


(Cody) #86

I’m nearly 50 percent done!


(Simon) #87

80% of my code is done … but the last 20% will take 80% of the time!


(Cody) #88

Am I allowed to compete? Because I could have just set the theme to a game I already made!


(Simon) #89

You can compete … questions will be asked if you win.


(Cody) #90

Fair enough. Finishing up now


(Simon) #91

Finishing? 3 hours ago you were only at 50% ??


(Cody) #92

Decided I didn’t need sound. Also decided that it was hard enough and anything else is beyond my skill including sound :unamused:


(Simon) #93

Meh … sound is overrated. I turn mine off.


(Stephane C) #94

I don’t agree to that completely, it all depends on the type of game and the memory you have left. I consider sound as much important as graphics. You can do without nice graphics but sometimes it’s the only thing that will engage and motivate the player to play the game.

Depending on the game sound may not be needed that much.


(Felipe Manga) #95

This reminds me: I should probably start some time soon. :scream:


(JohnnydCoder) #96

I’m making my game right now! :grinning:

I have a problem though: my bouncing, spikey object is not bouncing all over the screen like it should. :confused:

It is bouncing partly through the screen, but bouncing back halfway.

Here’s the code:

void spikeyMovement() {
      if(moveRight == true && spikey.x + 16 <= WIDTH) {
      spikey.x += 1;
      }
      if(moveRight == false && spikey.x >= 0) {
       spikey.x -= 1;
      }
      if(spikey.x == 0) {
        moveRight = true;
      }
      if(spikey.x + 16 == WIDTH) {
        moveRight = false;
      }
      if(moveDown == true && spikey.y + 16 <= HEIGHT) {
        spikey.y += 1;
      }
      if(moveDown == false && spikey.y >= 0) {
        spikey.y -= 1;
      }
      if(spikey.y == 0) {
        moveDown = true;
      }
      if(spikey.y + 16 == HEIGHT) {
        moveDown = false;
      } 
}

Can I have some help please?


(serisman) #97

One thing that seems incorrect is all of your if statements that end with … <= … or … >= …
You probably want to remove the equals so they read … < … or … > …

As it is, you are saying that if the ball is moving right and it current position plus width is less than or equal to the total width then it is ok to keep moving right. But, technically that will put it 1 pixel past the edge of the screen.

It gets worse on the leftward movement because you are going to take an x or y that already equals 0 and subtract 1 from it, making it -1 or even wrapping over to 255 (or some other value) depending on what type of variable x and y are.

EDIT: actually, that might not actually be an issue, because you are changing your direction prior to the next iteration.


(JohnnydCoder) #98

I tried your idea and it’s still not working.

Here’s a bigger portion of the code (the problem might not lie in the previous code):

bool moveRight = true;
bool moveDown = true;

struct Spikey {
  int x;
  int y;
  char image;
};

Spikey spikey = {32, 32, spikeyImage};

void drawSpikey() {
  if (dungeonZone == 1 || dungeonZone == 2 || dungeonZone == 3) {
spikey.image = spikeyImage[spikey.type];
arduboy.fillRect(spikey.x, spikey.y, 16, 16, BLACK);  
Sprites::drawExternalMask(spikey.x, spikey.y, spikeyImage, spikeyImage, spikey.type, spikey.type);
  }
}


void spikeyMovement() {
      if(moveRight == true && spikey.x + 16 < WIDTH) {
      spikey.x += 1;
      }
      if(moveRight == false && spikey.x > 0) {
       spikey.x -= 1;
      }
      if(spikey.x == 0) {
        moveRight = true;
      }
      if(spikey.x + 16 == WIDTH) {
        moveRight = false;
      }
      if(moveDown == true && spikey.y + 16 < HEIGHT) {
        spikey.y += 1;
      }
      if(moveDown == false && spikey.y > 0) {
        spikey.y -= 1;
      }
      if(spikey.y == 0) {
        moveDown = true;
      }
      if(spikey.y + 16 == HEIGHT) {
        moveDown = false;
      }
}

Thanks for your help!:slightly_smiling_face:


(serisman) #99

I don’t see where you are calling spikeyMovement in that example

I just tried this out in the ProjectABE emulator and it seems to be working correctly:

#define WIDTH         128
#define HEIGHT        64
#define SPIKEY_WIDTH  16
#define SPIKEY_HEIGHT 16

#include <Arduboy2.h>
Arduboy2 arduboy;

bool moveRight = true;
bool moveDown = true;

struct Spikey {
  int x;
  int y;
};

Spikey spikey = {32, 32};

const unsigned char spikeyImage[] PROGMEM  = {
 0xff, 0xdf, 0x7b, 0x3f, 0x9f, 0x6f, 0x77, 0xab, 0xdb, 0xd7, 0xcd, 0x5f, 0xbf, 0x77, 0xff, 0xff, 0xff, 0xc1, 0xdc, 0xd3, 0xaf, 0x9f, 0xae, 0xb0, 0xbb, 0xbd, 0xbd, 0xba, 0xd7, 0xcc, 0x63, 0xff
};

void setup() {
  arduboy.begin();
  arduboy.setFrameRate(15);
}

void loop() {
  if (!(arduboy.nextFrame()))
    return;

  arduboy.clear();
  spikeyMovement();
  arduboy.drawBitmap(spikey.x, spikey.y, spikeyImage, SPIKEY_WIDTH, SPIKEY_HEIGHT, WHITE);
  arduboy.display();
}

void spikeyMovement() {
  if (moveRight == true && spikey.x + SPIKEY_WIDTH <= WIDTH) {
    spikey.x += 1;
  }
  if (moveRight == false && spikey.x >= 0) {
    spikey.x -= 1;
  }
  if (spikey.x == 0) {
    moveRight = true;
  }
  if (spikey.x + SPIKEY_WIDTH == WIDTH) {
    moveRight = false;
  }
  if (moveDown == true && spikey.y + SPIKEY_HEIGHT <= HEIGHT) {
    spikey.y += 1;
  }
  if (moveDown == false && spikey.y >= 0) {
    spikey.y -= 1;
  }
  if (spikey.y == 0) {
    moveDown = true;
  }
  if (spikey.y + SPIKEY_HEIGHT == HEIGHT) {
    moveDown = false;
  }
}

(serisman) #100

you can also try this out (might be easier to see what is happening):

void spikeyMovement() {
  if (moveRight) {
    if (spikey.x + SPIKEY_WIDTH < WIDTH) {
      spikey.x += 1;
    } else {
      moveRight = false;
    }
  } else {
    if (spikey.x > 0) {
      spikey.x -= 1;
    } else {
      moveRight = true;
    }
  }

  if (moveDown) {
    if (spikey.y + SPIKEY_HEIGHT < HEIGHT) {
      spikey.y += 1;
    } else {
      moveDown = false;
    }
  } else {
    if (spikey.y > 0) {
      spikey.y -= 1;
    } else {
      moveDown = true;
    }
  }
}