Shiftavoid

rob1221

  • *
  • Posts: 9473
Update: the game is completed.  Here's my Ludum Dare page: http://ludumdare.com/compo/ludum-dare-31/?action=preview&uid=30105

For this LD I decided to make an avoider game with shifting levels.  I'll have a player, an exit, and 60 walls that change positions to a different level each time the player reaches the exit.  The levels will be designed by me but randomly chosen, and the objective of the game will be to move fast and complete as many levels as possible before the timer runs out.  Outside of the UI, no objects are created or destroyed, and no objects enter or leave the screen.

The levels will change with all objects sliding to the positions of the next level.  But since I'm not actually changing scenes, I need to figure out how to get the level data from my designed levels into my main game scene.  I'm thinking about an array converted to a string that contains the coordinates of the player and exit as well as the grid positions of the walls.  Since copying that data by hand would take a lot of time and would be  prone to error, I need to somehow copy the level data to the clipboard, and that's what I'm working on right now.

« Last Edit: December 07, 2014, 05:51:29 pm by rob1221 »

letmethink

  • *
  • Posts: 2545
Funny you mention copying to the clipboard level data. I've actually done that before when I built a scanning and a building of a level for a randomly generated world. It'll be interesting to see whether you do it similarly to how I did.
~Letmethink

rob1221

  • *
  • Posts: 9473
Code: [Select]
69,98,224,96,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,0,0,0,1,1,0,0,0,1,1,0,0,0,1,1,0,0,0,1,1,0,0,0,1,1,0,0,0,1,1,0,0,0,1,1,0,0,0,1,1,0,0,0,1,1,0,0,0,1,1,0,0,0,1,1,0,0,0,1,1,0,0,0,1,1,0,0,0,1,1,0,0,0,1,1,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1
That's one of my level strings.  The first two numbers are the X and Y positions of the player, and the next two numbers are the X and Y positions of the exit.  The rest of the numbers represent the 140 grid squares in my game, a 1 representing a wall actor.  Attached is the behavior I used (I didn't really need the import or custom block).

letmethink

  • *
  • Posts: 2545
That does look very similar to the formatting I used, but I think in mine I added a value defining the size of the grid as this would change between segments. Interesting technique anyhow.
~Letmethink

rob1221

  • *
  • Posts: 9473
Most of the level switching part is done, but nothing else is:

I avoided the problem of repeated levels by making two lists, one that the levels are picked from and another that stores levels that have been recently picked.  The second list currently stores 3 levels, so you should never see a level show up again until 2 different levels have been picked.

Updated with gameplay and more levels.

Music done but could use more polish.  I'll go back to it if I have time.

« Last Edit: December 07, 2014, 05:50:07 pm by rob1221 »


Abliblablobla

  • *
  • Posts: 524
Nice game. How many different levels does this game include? I feel like they are repeating after some time. By the way, my high score is 14!
.: BuruBuru :.

rob1221

  • *
  • Posts: 9473
There are only 10 levels that are randomly chosen (except the starting level).