Topic:   Adventure 4   (Read 19405 times)


0 Members and 1 Guest are viewing this topic.

Zoo


  • GMG Extraordinaire

  • ***


  • Posts: 1686
    • My Bandcamp
Adventure 4
« 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
Kirby, your pudgy buddy from dream land, is back again on the game boy®!

Charlo


  • GMG-er

  • **


  • Posts: 451
Re: Adventure 4
« Reply #1 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?

Zoo


  • GMG Extraordinaire

  • ***


  • Posts: 1686
    • My Bandcamp
Re: Adventure 4
« Reply #2 on: February 14, 2011, 03:06:24 PM »
Yeah, pretty much, and depending on what you do, the ending will be different.
Kirby, your pudgy buddy from dream land, is back again on the game boy®!

Zoo


  • GMG Extraordinaire

  • ***


  • Posts: 1686
    • My Bandcamp
Re: Adventure 4
« Reply #3 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.
« Last Edit: February 14, 2011, 03:18:42 PM by zoo804 »
Kirby, your pudgy buddy from dream land, is back again on the game boy®!

EqwanoX


  • Administrator

  • GMG Extraordinaire

  • *****


  • Posts: 1180
Re: Adventure 4
« Reply #4 on: February 14, 2011, 03:17:13 PM »
if this is SC, you need "LET x=0"

Zoo


  • GMG Extraordinaire

  • ***


  • Posts: 1686
    • My Bandcamp
Re: Adventure 4
« Reply #5 on: February 14, 2011, 03:19:00 PM »
Nope, sorry. I'm a GM guy.
Kirby, your pudgy buddy from dream land, is back again on the game boy®!

Silverwind


  • ^ This guy is amazing.

  • ****


  • Posts: 2805

  • For the glory of my maker
Re: Adventure 4
« Reply #6 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. :)
I survived the spammage of 2007

Zoo


  • GMG Extraordinaire

  • ***


  • Posts: 1686
    • My Bandcamp
Re: Adventure 4
« Reply #7 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$

Kirby, your pudgy buddy from dream land, is back again on the game boy®!

Zoo


  • GMG Extraordinaire

  • ***


  • Posts: 1686
    • My Bandcamp
Re: Adventure 4
« Reply #8 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
Kirby, your pudgy buddy from dream land, is back again on the game boy®!

Zoo


  • GMG Extraordinaire

  • ***


  • Posts: 1686
    • My Bandcamp
Re: Adventure 4
« Reply #9 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.
Kirby, your pudgy buddy from dream land, is back again on the game boy®!

Zoo


  • GMG Extraordinaire

  • ***


  • Posts: 1686
    • My Bandcamp
Re: Adventure 4
« Reply #10 on: February 14, 2011, 05:55:48 PM »
You will be able to do different quests for people (depending on your job).
Kirby, your pudgy buddy from dream land, is back again on the game boy®!

Silverwind


  • ^ This guy is amazing.

  • ****


  • Posts: 2805

  • For the glory of my maker
Re: Adventure 4
« Reply #11 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?
I survived the spammage of 2007

Zoo


  • GMG Extraordinaire

  • ***


  • Posts: 1686
    • My Bandcamp
Re: Adventure 4
« Reply #12 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.
Kirby, your pudgy buddy from dream land, is back again on the game boy®!

Connors


  • ^ This guy is amazing.

  • ****


  • Posts: 2374

  • It's a secret to everyone...
Re: Adventure 4
« Reply #13 on: February 15, 2011, 10:18:29 PM »
So it's a modern setting then? I'm becoming more curious now.
Warning: The above post may have been modified multiple times.

"In a great game, the character must never perfectly obey the user's command"
 - Tim Rogers

http://connorspuzzles.tumblr.com/

Silverwind


  • ^ This guy is amazing.

  • ****


  • Posts: 2805

  • For the glory of my maker
Re: Adventure 4
« Reply #14 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. ;)
I survived the spammage of 2007