Game Maker's Garage Forum

Game Maker's Garage => Announcements => Topic started by: Zoo on February 13, 2011, 01:51:00 PM

Title: Adventure 4
Post by: Zoo on February 13, 2011, 01:51:00 PM
Now I know that you've never played my first 3 Adventure games. In short, they stink. But I'm working on a fourth one. Gameplay inside a building will be like my escape the house game, but using Grid navigation outside. If you have any ideas for the game, or feedback when it's done (which wont be for a while now), post it here.
Things I might add:
-Job choice ( pick what you want to do maybe 3 different jobs)
-naming your charactor
-Turn based battle (simple engine anyone? I could just program my own)
-custom cursors
-multiple endings (that is what the series is about)
-Better name
Title: Re: Adventure 4
Post by: Charlo on February 13, 2011, 05:56:35 PM
A combination of RPG-style grid navigation and 3d-style building navigation could be cool.  What would the goal be?  Just make money and buy stuff?
Title: Re: Adventure 4
Post by: Zoo on February 14, 2011, 03:06:24 PM
Yeah, pretty much, and depending on what you do, the ending will be different.
Title: Re: Adventure 4
Post by: Zoo on February 14, 2011, 03:14:57 PM
Hey does anyone know what's wrong with this code?
IF npcGridY = 1 THEN npcAlive = 0
EDIT: In case you were wondering, it's the code for a car that disappears when it gets to the end of a map. If you have a better way to do that, you should tell me.
Title: Re: Adventure 4
Post by: EqwanoX on February 14, 2011, 03:17:13 PM
if this is SC, you need "LET x=0"
Title: Re: Adventure 4
Post by: Zoo on February 14, 2011, 03:19:00 PM
Nope, sorry. I'm a GM guy.
Title: Re: Adventure 4
Post by: Silverwind on February 14, 2011, 04:56:20 PM
There's nothing wrong with that code on its own, but the problem may lie with the values assigned (or not assigned) to the variables earlier on in your code. If you post the full thing I'll likely spot the problem. :)
Title: Re: Adventure 4
Post by: Zoo on February 14, 2011, 05:43:13 PM
PRINT You are in the city
PICT currentCard

'--- Set the properties of the room.
northRoom = 0
southRoom = 0
westRoom = 0
eastRoom = 0

gridSize = 7
gridRow1$ = "1010101"
gridRow2$ = "0000000"
gridRow3$ = "1010101"
gridRow4$ = "0000000"
gridRow5$ = "1010101"
gridRow6$ = "0000000"
gridRow7$ = "1010101"

signpost1GridX = 1
signpost1GridY = 1
signpost1Text$ = "Signpost:"

signpost2GridX = 1
signpost2GridY = 3
signpost2Text$ = "Signpost: This building is under construction"

signpost3GridX = 5
signpost3GridY = 3
signpost3Text$ = "Signpost: This building is under construction"

signpost4GridX = 7
signpost4GridY = 3
signpost4Text$ = "Signpost: This building is under construction"

signpost5GridX = 3
signpost5GridY = 3
signpost5Text$ = "Signpost: This building is under construction"

randnpc = RANDOM 2 4 6

'--- Edit these vars to set the attributes of the NPC.
npcAlive = 1
npcSprite$ = "car.gif"
npcGridX = 7
npcGridY = randnpc
npcSpeech$ = ""

'--- Determine the player's sprite coordinates based on its grid coordinates.
playerSpriteY = playerGridY * tileSize
playerSpriteY = playerSpriteY - tileSize
playerSpriteY = playerSpriteY + 5
playerSpriteX = playerGridX * tileSize
playerSpriteX = playerSpriteX - tileSize
playerSpriteX = playerSpriteX + 5
SPRITE playerSpriteLayer playerSpriteX playerSpriteY $playerSprite$$

' --- Determine the NPC's sprite coordinates based on its grid coordinates.
npcSpriteY = npcGridY * tileSize
npcSpriteY = npcSpriteY - tileSize
npcSpriteY = npcSpriteY + 5
npcSpriteX = npcGridX * tileSize
npcSpriteX = npcSpriteX - tileSize
npcSpriteX = npcSpriteX + 5
SPRITE npcSpriteLayer npcSpriteX npcSpriteY $npcSprite$$

'------------------------------------------------------------------------------------------------

ON KEYDOWN
  playerNewGridX = playerGridX
  playerNewGridY = playerGridY

  '--- Check which direction the player wants to move in.
  IF keydown$ = "UPARROW" THEN playerNewGridY = playerGridY - 1
  IF keydown$ = "DOWNARROW" THEN playerNewGridY = playerGridY + 1
  IF keydown$ = "LEFTARROW" THEN playerNewGridX = playerGridX - 1
  IF keydown$ = "RIGHTARROW" THEN playerNewGridX = playerGridX + 1

  '--- Get the collision classes of the Y row.
  IF playerNewGridY = 1 THEN gridRow$ = gridRow1$
  IF playerNewGridY = 2 THEN gridRow$ = gridRow2$
  IF playerNewGridY = 3 THEN gridRow$ = gridRow3$
  IF playerNewGridY = 4 THEN gridRow$ = gridRow4$
  IF playerNewGridY = 5 THEN gridRow$ = gridRow5$
  IF playerNewGridY = 6 THEN gridRow$ = gridRow6$
  IF playerNewGridY = 7 THEN gridRow$ = gridRow7$

Title: Re: Adventure 4
Post by: Zoo on February 14, 2011, 05:43:31 PM

  '--- Get the collision class of the new tile.
  playerTile$ = MID$ gridRow$ playerNewGridX 1
  IF playerTile$ = "" THEN playerTile$ = "Wall"
  IF playerTile$ = "0" THEN playerTile$ = "Empty"
  IF playerTile$ = "1" THEN playerTile$ = "Wall"

  '--- Check if the player is trying to leave the grid.
  IF playerNewGridX < 1 THEN
    playerTile$ = "Wall"
    IF westRoom <> 0 THEN
      playerGridX = gridSize
      GOTOCARD westRoom
    END IF
  END IF
  IF playerNewGridX > gridSize THEN
    playerTile$ = "Wall"
    IF eastRoom <> 0 THEN
      playerGridX = 1
      GOTOCARD eastRoom
    END IF
  END IF
  IF playerNewGridY < 1 THEN
    playerTile$ = "Wall"
    IF northRoom <> 0 THEN
      playerGridY = gridSize
      GOTOCARD northRoom
    END IF
  END IF
  IF playerNewGridY > gridSize THEN
    playerTile$ = "Wall"
    IF southRoom <> 0 THEN
      playerGridY = 1
      GOTOCARD southRoom
    END IF
  END IF

  '--- Check for collision with an npc.
  IF playerNewGridX = npcGridX THEN
    IF playerNewGridY = npcGridY THEN
      playerTile$ = "Wall"
      ALERT $npcSpeech$$
    END IF
  END IF

  '--- Check for collision with a signpost.
  IF playerNewGridX = signpost1GridX THEN
    IF playerNewGridY = signpost1GridY THEN GOTOCARD 16
  END IF

   IF playerNewGridX = signpost2GridX THEN
    IF playerNewGridY = signpost2GridY THEN ALERT $signpost2Text$$
  END IF
 
  IF playerNewGridX = signpost3GridX THEN
    IF playerNewGridY = signpost3GridY THEN ALERT $signpost3Text$$
  END IF

IF playerNewGridX = signpost4GridX THEN
    IF playerNewGridY = signpost4GridY THEN ALERT $signpost4Text$$
  END IF

IF playerNewGridX = signpost5GridX THEN
    IF playerNewGridY = signpost5GridY THEN GOTOCARD 23
  END IF


 
  '--- If the tile has no obstacles on it, move the player onto the tile.
  IF playerTile$ = "Empty" THEN
    playerGridX = playerNewGridX
    playerGridY = playerNewGridY
    '--- Determine the player's sprite coordinates based on its grid coordinates.
    playerSpriteY = playerGridY * tileSize
    playerSpriteY = playerSpriteY - tileSize
    playerSpriteY = playerSpriteY + 5
    playerSpriteX = playerGridX * tileSize
    playerSpriteX = playerSpriteX - tileSize
    playerSpriteX = playerSpriteX + 5
    SPRITEPATH playerSpriteLayer playerSpriteX playerSpriteY entitySpriteMoveSpeed
  END IF

'------------------------------------------------------------------------------------------------

  IF npcAlive = 1 THEN
    npcNewGridX = npcGridX
    npcNewGridY = npcGridY

    '--- This is the NPC's AI. It determines which action the NPC will attempt to perform each turn.

npcAction$ = "Move Left"


    '--- Check which direction the NPC wants to move in.
    IF npcAction$ = "Move Up" THEN npcNewGridY = npcGridY - 1
    IF npcAction$ = "Move Down" THEN npcNewGridY = npcGridY + 1
    IF npcAction$ = "Move Left" THEN npcNewGridX = npcGridX - 1
    IF npcAction$ = "Move Right" THEN npcNewGridX = npcGridX + 1

    '--- Get the collision classes of the Y row.
    IF npcNewGridY = 1 THEN gridRow$ = gridRow1$
    IF npcNewGridY = 2 THEN gridRow$ = gridRow2$
    IF npcNewGridY = 3 THEN gridRow$ = gridRow3$
    IF npcNewGridY = 4 THEN gridRow$ = gridRow4$
    IF npcNewGridY = 5 THEN gridRow$ = gridRow5$
    IF npcNewGridY = 6 THEN gridRow$ = gridRow6$
    IF npcNewGridY = 7 THEN gridRow$ = gridRow7$

    '--- Get the collision class of the new tile.
    npcTile$ = MID$ gridRow$ npcNewGridX 1
    IF npcTile$ = "0" THEN npcTile$ = "Empty"

    '--- Stop the npc from leaving the grid.
    IF npcNewGridX < 1 THEN npcTile$ = "Wall"
    IF npcNewGridX > gridSize THEN npcTile$ = "Wall"
    IF npcNewGridY < 1 THEN npcTile$ = "Wall"
    IF npcNewGridY > gridSize THEN npcTile$ = "Wall"

    '--- Check for collision with the player.
    IF npcNewGridX = playerGridX THEN
      IF npcNewGridY = playerGridY THEN npcTile$ = "Wall"
    END IF

IF npcGridY = 1 THEN npcAlive = 0

    '--- If the tile has no obstacles on it, move the NPC onto the tile.
    IF npcTile$ = "Empty" THEN
      npcGridX = npcNewGridX
      npcGridY = npcNewGridY
      '--- Determine the NPC's sprite coordinates based on its grid coordinates.
      npcSpriteY = npcGridY * tileSize
      npcSpriteY = npcSpriteY - tileSize
      npcSpriteY = npcSpriteY + 5
      npcSpriteX = npcGridX * tileSize
      npcSpriteX = npcSpriteX - tileSize
      npcSpriteX = npcSpriteX + 5
      SPRITEPATH npcSpriteLayer npcSpriteX npcSpriteY entitySpriteMoveSpeed
    END IF
  END IF
END KEYDOWN


Sorry, it was too long
Title: Re: Adventure 4
Post by: Zoo on February 14, 2011, 05:44:27 PM
Lol. I had no idea how long the code was!  :D A code this long makes you proud.
Title: Re: Adventure 4
Post by: Zoo on February 14, 2011, 05:55:48 PM
You will be able to do different quests for people (depending on your job).
Title: Re: Adventure 4
Post by: Silverwind on February 15, 2011, 02:23:26 AM
Hmmm.... it's hard to read nested code on the forum since all the tablature gets messed up, but I don't see anything wrong with it. What's happening when you run the source?

Quote
Lol. I had no idea how long the code was!  :D A code this long makes you proud.
Yup. Incidentally, isn't that one of my templates? ;D

Quote
You will be able to do different quests for people (depending on your job).
Cool! What's the idea with the disappearing cars?
Title: Re: Adventure 4
Post by: Zoo on February 15, 2011, 03:19:09 PM
When they get to the end of the screen, they should disapear, but they dont. I'm gonna try to make it so a car goes by in a random place, and you lose health if you get hit.
Title: Re: Adventure 4
Post by: Connors on February 15, 2011, 10:18:29 PM
So it's a modern setting then? I'm becoming more curious now.
Title: Re: Adventure 4
Post by: Silverwind on February 16, 2011, 05:21:50 AM
Quote
When they get to the end of the screen, they should disapear, but they dont.
Ah, but you're not actually executing any code to make the sprite invisible, you're just changing the value of a variable (npcAlive = 0). Try this:

Code: [Select]
IF npcGridY = 1 THEN
  npcAlive = 0
  SPRITE -npcSpriteLayer
END IF

You'll also need to add an IF THEN condition to the fourth-last line of code in the KEYDOWN block:

Code: [Select]
IF npcAlive = 1 THEN SPRITEPATH npcSpriteLayer npcSpriteX npcSpriteY entitySpriteMoveSpeed 

That should do the trick. ;)
Title: Re: Adventure 4
Post by: Zoo on February 16, 2011, 03:17:53 PM
hmm. Is there any of this text I should change to fit my specific code? If not, Where in the code should I put it, inside or outside the keydown?
Title: Re: Adventure 4
Post by: InfernoLimited on May 22, 2011, 12:49:01 PM
Personally, I very much enjoyed Escape The House.
Title: Re: Adventure 4
Post by: Zoo on May 22, 2011, 01:36:19 PM
Thanks dude. I may make a sequel sometime in the near future.
Title: Re: Adventure 4
Post by: InfernoLimited on May 22, 2011, 02:46:24 PM
Something makes me want to do a sequel for a game that's not even mine.
Title: Re: Adventure 4
Post by: Zoo on May 22, 2011, 03:51:26 PM
You might be able to get some inspiration off of addicting games. They've got tons of escape games.
Title: Re: Adventure 4
Post by: Connors on May 22, 2011, 10:45:24 PM
Just had a great idea for a way to put together a choose-your-own-adventure type game. (I keep thinking this sounds fun since they're quick to program).
Title: Men Dating Men: Celebrating Adulation and Connection
Post by: Robertgal on March 22, 2024, 07:23:08 AM
Men dating men sample tenderness, union, and the belle of relationships in their own incomparable way.
https://gay0day.com/search/family-incest/
In a everyone that embraces diverseness and inclusivity, same-sex relationships from develop their place. Men who ancient men sail the joys and challenges of edifice expressive connections based on authenticity and reciprocal understanding. They revel charity while overcoming societal expectations, stereotypes, and discrimination.
https://hentai0day.com/tags/hentai-game-gallery/
Communication and heartfelt intimacy play a momentous task in their relationships, fostering positiveness and deepening their bond. As society progresses close to equality, it is important to approve and particular the care shared between men dating men, embracing their together experiences and contributions to the tapestry of kind-hearted connections.