Topic:   Simple Rougelike project download   (Read 9428 times)


0 Members and 1 Guest are viewing this topic.

Johna100


  • GMG-er

  • **


  • Posts: 173

  • lalala
Simple Rougelike project download
« on: August 03, 2020, 10:03:13 AM »
Here is a starting point for anyone who wants to make a rougelike. A lot can be improved like the level design. You could add items and more stats for the character.
https://drive.google.com/file/d/1osX-RCjh2334BzWsqoEfKN9wxsSREuzw/view?usp=sharing

Johna100


  • GMG-er

  • **


  • Posts: 173

  • lalala
Re: Simple Rougelike project download
« Reply #1 on: August 03, 2020, 10:05:32 AM »
You need SilverCreator v2.0b6
http://www.silvercreator.net/
« Last Edit: August 04, 2020, 10:23:23 AM by Johna100 »

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Re: Simple Rougelike project download
« Reply #2 on: August 07, 2020, 02:31:02 AM »
SilverCreator crashes when I attempt to run it. Using latest SC with Mac OS 10.15.5.

Johna100


  • GMG-er

  • **


  • Posts: 173

  • lalala
Re: Simple Rougelike project download
« Reply #3 on: August 07, 2020, 12:55:23 PM »
Hmm. I have that problem with some of my programs but that one worked on my computer.

Johna100


  • GMG-er

  • **


  • Posts: 173

  • lalala
Re: Simple Rougelike project download
« Reply #4 on: August 07, 2020, 07:28:03 PM »
HERE IS THE CODE IF THE DOWNLOAD FILE DOES NOT WORK.

Make a project with the jumbo setting and paint the screen back.

OPEN GAME

Code: [Select]
LET life = 90
LET attack = 4





OPEN CARD

Code: [Select]
IF newLevel = 0 THEN
   LET newLevel = 1
   LET numberOfMon = 50
   
   LET toggleFirst = 0
   LET toggleSecond = 0
   
   LET scrolly = 0
   LET scrollx = 0
   
   DIM world$(10000)
   DIM tile$(10000)
   DIM colAmain(10000)
   DIM colBmain(10000)
   DIM colCmain(10000)
   DIM colA(10000)
   DIM colB(10000)
   DIM colC(10000)
   DIM monPos(numberOfMon)
   DIM monChar$(numberOfMon)
   DIM monColA(numberOfMon)
   DIM monColB(numberOfMon)
   DIM monColC(numberOfMon)
   DIM monName$(numberOfMon)
   DIM monLife(numberOfMon)
   DIM monAttack(numberOfMon)
   
   FOR a = 1 to 10000
      LET world$(a) = "#"
      LET colAmain(a) = 150
      LET colBmain(a) = 150
      LET colCmain(a) = 150
   NEXT
   
   LET roomsStart = 5550
   LET nextRoom = roomsStart
   
   FOR a = 1 to 18
      LET nextRoom = nextRoom - 1
      LET createFloory = nextRoom
      IF a = 6 THEN
         LET nextRoom = roomsStart
         LET nextRoom = nextRoom - 1
      END IF
      IF a = 12 THEN
         LET nextRoom = roomsStart
         LET nextRoom = nextRoom - 1
      END IF
      FOR b = 1 to 5
         IF toggleFirst > 0 THEN
            LET createFloory = createFloory + 100
            LET nextRoom = createFloory + 100
         END IF
         LET toggleFirst = 1
         LET createFloorx = createFloory
         LET nextRoom = createFloory
         FOR c = 1 to 5
            IF toggleSecond > 0 THEN
               LET createFloorx = createFloorx + 1
               LET nextRoom = nextRoom + 1
            END IF
            LET toggleSecond = 1
            IF createFloorx > 100 THEN
               IF createFloorx < 9900 THEN
                  LET world$(createFloorx) = "."
                  LET colAmain(createFloorx) = 150
                  LET colBmain(createFloorx) = 150
                  LET colCmain(createFloorx) = 150
               END IF
            END IF
         NEXT
      NEXT
      LET hallDir = RANDOM(4)
      LET createHall = nextRoom
      FOR d = 1 to 22
         IF hallDir = 1 THEN
            LET createHall = createHall + 1
            LET nextRoom = nextRoom + 1
         END IF
         IF hallDir = 2 THEN
            LET createHall = createHall - 1
            LET nextRoom = nextRoom - 1
         END IF
         IF hallDir = 3 THEN
            LET createHall = createHall + 100
            LET nextRoom = nextRoom + 100
         END IF
         IF hallDir = 4 THEN
            LET createHall = createHall - 100
            LET nextRoom = nextRoom - 100
         END IF
         
         IF createHall > 100 THEN
            IF createHall < 9900 THEN
               
               LET world$(createHall) = "."
               LET colAmain(createHall) = 150
               LET colBmain(createHall) = 150
               LET colCmain(createHall) = 150
            END IF
         END IF
      NEXT
     
   NEXT
   
   
   
   // PLACE MONSTERS
   
   FOR monPlacer = 1 to numberOfMon
     
      LET monPos(monPlacer) = RANDOM(10000)
      IF world$(monPos(monPlacer)) = "." THEN
         LET RND = RANDOM(3)
         IF RND = 1 THEN
            LET monChar$(monPlacer) = "g"
            LET monColA(monPlacer) = 150
            LET monColB(monPlacer) = 70
            LET monColC(monPlacer) = 70
            LET monName$(monPlacer) = "Goblin"
            LET monLife(monPlacer) = 22
            LET monAttack(monPlacer) = 9
         END IF
         IF RND = 2 THEN
            LET monChar$(monPlacer) = "s"
            LET monColA(monPlacer) = 70
            LET monColB(monPlacer) = 70
            LET monColC(monPlacer) = 150
            LET monName$(monPlacer) = "Snake"
            LET monLife(monPlacer) = 12
            LET monAttack(monPlacer) = 7
         END IF
         IF RND = 3 THEN
            LET monChar$(monPlacer) = "r"
            LET monColA(monPlacer) = 150
            LET monColB(monPlacer) = 70
            LET monColC(monPlacer) = 150
            LET monName$(monPlacer) = "Rat"
            LET monLife(monPlacer) = 5
            LET monAttack(monPlacer) = 4
         END IF
         
      END IF
   NEXT
   
   LET scrolly = scrolly - 360
   LET scrollx = scrollx - 290
   LET playerPos = 5550
   LET posYcounter = 10
   LET posXcounter = 10
END IF

FOR b = 1 to 10000
   LET colA(b) = colAmain(b)
   LET colB(b) = colBmain(b)
   LET colC(b) = colCmain(b)
   LET tile$(b) = world$(b)
NEXT

LET colA(playerPos) = 420
LET colB(playerPos) = 420
LET colC(playerPos) = 420
LET tile$(playerPos) = "P"

FOR a = 1 to numberOfMon
   
   LET monRNDmove = RANDOM(4)
   IF monPos(a) > 100 THEN
     
      IF monRNDmove = 1 THEN
         LET monPos(a) = monPos(a) - 100
         
         IF tile$(monPos(a)) = "#" THEN
            LET monPos(a) = monPos(a) + 100
         END IF
         
      END IF
     
      IF monRNDmove = 2 THEN
         LET monPos(a) = monPos(a) - 1
         
         IF tile$(monPos(a)) = "#" THEN
            LET monPos(a) = monPos(a) + 1
         END IF
         
      END IF
     
   END IF
   
   
   
   IF monPos(a) < 9900 THEN
     
      IF monRNDmove = 3 THEN
         LET monPos(a) = monPos(a) + 1
         
         IF tile$(monPos(a)) = "#" THEN
            LET monPos(a) = monPos(a) - 1
         END IF
         
      END IF
     
     
     
      IF monRNDmove = 4 THEN
         LET monPos(a) = monPos(a) + 100
         
         IF tile$(monPos(a)) = "#" THEN
            LET monPos(a) = monPos(a) - 100
         END IF
         
      END IF
     
   END IF
   
   
   LET colA(monPos(a)) = monColA(a)
   LET colB(monPos(a)) = monColB(a)
   LET colC(monPos(a)) = monColC(a)
   LET tile$(monPos(a)) = monChar$(a)
NEXT

CLEAR
PRINT "Press the spacebar key, type lower level then press the enter key to go to the next floor down"
PRINT " "

FOR a = 1 to numberOfMon
   
   IF playerPos = monPos(a) THEN
     
      LET life = life - monAttack(a)
      LET monLife(a) = monLife(a) - attack
     
      PRINT monName$(a) + " attacked you"
      PRINT "Your life is now " + STR$(life)
     
      PRINT "You Attacked " + monName$(a) + " for " + STR$(attack)
     
   END IF
   
NEXT





KEY DOWN

Code: [Select]
IF playerPos > 100 THEN
   
   IF UPKEY = TRUE THEN
      LET playerPos = playerPos - 100
      IF posYcounter < 14 THEN
         LET posYcounter = posYcounter + 1
      END IF
      IF posYcounter = 14 THEN
         LET scrolly = scrolly + 10
      END IF
     
      IF tile$(playerPos) = "#" THEN
         LET playerPos = playerPos + 100
      END IF
     
      GOTOCARD 1
   END IF
   
   IF LEFTKEY = TRUE THEN
      LET playerPos = playerPos - 1
      IF posXcounter > 6 THEN
         LET posXcounter = posXcounter - 1
      END IF
      IF posXcounter = 6 THEN
         LET scrollx = scrollx + 10
      END IF
     
      IF tile$(playerPos) = "#" THEN
         LET playerPos = playerPos + 1
      END IF
     
      GOTOCARD 1
   END IF
   
END IF



IF playerPos < 9900 THEN
   
   IF RIGHTKEY = TRUE THEN
      LET playerPos = playerPos + 1
      IF posXcounter < 14 THEN
         LET posXcounter = posXcounter + 1
      END IF
      IF posXcounter = 14 THEN
         LET scrollx = scrollx - 10
      END IF
     
      IF tile$(playerPos) = "#" THEN
         LET playerPos = playerPos - 1
      END IF
     
      GOTOCARD 1
   END IF
   
   
   
   IF DOWNKEY = TRUE THEN
      LET playerPos = playerPos + 100
      IF posYcounter > 6 THEN
         LET posYcounter = posYcounter - 1
      END IF
      IF posYcounter = 6 THEN
         LET scrolly = scrolly - 10
      END IF
     
      IF tile$(playerPos) = "#" THEN
         LET playerPos = playerPos - 100
      END IF
     
      GOTOCARD 1
   END IF
   
END IF

IF SPACEBARKEY = TRUE THEN
   INPUT
END IF







INPUT

Code: [Select]
IF INPUT$ = "lower level" THEN
   LET newLevel = 0
   GOTOCARD 1
END IF







PAINT

Code: [Select]
LET paintNew = 1
LET fontSize = 12
LET padding = 10
LET tileNum = 0
LET ty = scrolly


FOR j = 1 to 100
   LET ty = ty + padding
   LET tx = scrollx
   FOR a = 1 to 100
      LET tileNum = tileNum + 1
      LET tx = tx + padding
      SETPENCOLOR colA(tileNum), colB(tileNum), colC(tileNum)
      DRAWSTRING tile$(tileNum), tx, ty, "Courier", fontSize
   NEXT
NEXT





Johna100


  • GMG-er

  • **


  • Posts: 173

  • lalala
Re: Simple Rougelike project download
« Reply #5 on: August 07, 2020, 07:31:03 PM »
See if that works.

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Re: Simple Rougelike project download
« Reply #6 on: August 08, 2020, 12:56:39 AM »
Looks like I'm missing a function name monPos.

Johna100


  • GMG-er

  • **


  • Posts: 173

  • lalala
Re: Simple Rougelike project download
« Reply #7 on: August 08, 2020, 06:19:21 AM »
Im not sure how that got missing. Its in my code.

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Re: Simple Rougelike project download
« Reply #8 on: August 10, 2020, 03:50:06 PM »
I followed the code you posted up above:
HERE IS THE CODE IF THE DOWNLOAD FILE DOES NOT WORK.

Make a project with the jumbo setting and paint the screen back.

OPEN GAME

Code: [Select]
LET life = 90
LET attack = 4





OPEN CARD

Code: [Select]
IF newLevel = 0 THEN
   LET newLevel = 1
   LET numberOfMon = 50
   
   LET toggleFirst = 0
   LET toggleSecond = 0
   
   LET scrolly = 0
   LET scrollx = 0
   
   DIM world$(10000)
   DIM tile$(10000)
   DIM colAmain(10000)
   DIM colBmain(10000)
   DIM colCmain(10000)
   DIM colA(10000)
   DIM colB(10000)
   DIM colC(10000)
   DIM monPos(numberOfMon)
   DIM monChar$(numberOfMon)
   DIM monColA(numberOfMon)
   DIM monColB(numberOfMon)
   DIM monColC(numberOfMon)
   DIM monName$(numberOfMon)
   DIM monLife(numberOfMon)
   DIM monAttack(numberOfMon)
   
   FOR a = 1 to 10000
      LET world$(a) = "#"
      LET colAmain(a) = 150
      LET colBmain(a) = 150
      LET colCmain(a) = 150
   NEXT
   
   LET roomsStart = 5550
   LET nextRoom = roomsStart
   
   FOR a = 1 to 18
      LET nextRoom = nextRoom - 1
      LET createFloory = nextRoom
      IF a = 6 THEN
         LET nextRoom = roomsStart
         LET nextRoom = nextRoom - 1
      END IF
      IF a = 12 THEN
         LET nextRoom = roomsStart
         LET nextRoom = nextRoom - 1
      END IF
      FOR b = 1 to 5
         IF toggleFirst > 0 THEN
            LET createFloory = createFloory + 100
            LET nextRoom = createFloory + 100
         END IF
         LET toggleFirst = 1
         LET createFloorx = createFloory
         LET nextRoom = createFloory
         FOR c = 1 to 5
            IF toggleSecond > 0 THEN
               LET createFloorx = createFloorx + 1
               LET nextRoom = nextRoom + 1
            END IF
            LET toggleSecond = 1
            IF createFloorx > 100 THEN
               IF createFloorx < 9900 THEN
                  LET world$(createFloorx) = "."
                  LET colAmain(createFloorx) = 150
                  LET colBmain(createFloorx) = 150
                  LET colCmain(createFloorx) = 150
               END IF
            END IF
         NEXT
      NEXT
      LET hallDir = RANDOM(4)
      LET createHall = nextRoom
      FOR d = 1 to 22
         IF hallDir = 1 THEN
            LET createHall = createHall + 1
            LET nextRoom = nextRoom + 1
         END IF
         IF hallDir = 2 THEN
            LET createHall = createHall - 1
            LET nextRoom = nextRoom - 1
         END IF
         IF hallDir = 3 THEN
            LET createHall = createHall + 100
            LET nextRoom = nextRoom + 100
         END IF
         IF hallDir = 4 THEN
            LET createHall = createHall - 100
            LET nextRoom = nextRoom - 100
         END IF
         
         IF createHall > 100 THEN
            IF createHall < 9900 THEN
               
               LET world$(createHall) = "."
               LET colAmain(createHall) = 150
               LET colBmain(createHall) = 150
               LET colCmain(createHall) = 150
            END IF
         END IF
      NEXT
     
   NEXT
   
   
   
   // PLACE MONSTERS
   
   FOR monPlacer = 1 to numberOfMon
     
      LET monPos(monPlacer) = RANDOM(10000)
      IF world$(monPos(monPlacer)) = "." THEN
         LET RND = RANDOM(3)
         IF RND = 1 THEN
            LET monChar$(monPlacer) = "g"
            LET monColA(monPlacer) = 150
            LET monColB(monPlacer) = 70
            LET monColC(monPlacer) = 70
            LET monName$(monPlacer) = "Goblin"
            LET monLife(monPlacer) = 22
            LET monAttack(monPlacer) = 9
         END IF
         IF RND = 2 THEN
            LET monChar$(monPlacer) = "s"
            LET monColA(monPlacer) = 70
            LET monColB(monPlacer) = 70
            LET monColC(monPlacer) = 150
            LET monName$(monPlacer) = "Snake"
            LET monLife(monPlacer) = 12
            LET monAttack(monPlacer) = 7
         END IF
         IF RND = 3 THEN
            LET monChar$(monPlacer) = "r"
            LET monColA(monPlacer) = 150
            LET monColB(monPlacer) = 70
            LET monColC(monPlacer) = 150
            LET monName$(monPlacer) = "Rat"
            LET monLife(monPlacer) = 5
            LET monAttack(monPlacer) = 4
         END IF
         
      END IF
   NEXT
   
   LET scrolly = scrolly - 360
   LET scrollx = scrollx - 290
   LET playerPos = 5550
   LET posYcounter = 10
   LET posXcounter = 10
END IF

FOR b = 1 to 10000
   LET colA(b) = colAmain(b)
   LET colB(b) = colBmain(b)
   LET colC(b) = colCmain(b)
   LET tile$(b) = world$(b)
NEXT

LET colA(playerPos) = 420
LET colB(playerPos) = 420
LET colC(playerPos) = 420
LET tile$(playerPos) = "P"

FOR a = 1 to numberOfMon
   
   LET monRNDmove = RANDOM(4)
   IF monPos(a) > 100 THEN
     
      IF monRNDmove = 1 THEN
         LET monPos(a) = monPos(a) - 100
         
         IF tile$(monPos(a)) = "#" THEN
            LET monPos(a) = monPos(a) + 100
         END IF
         
      END IF
     
      IF monRNDmove = 2 THEN
         LET monPos(a) = monPos(a) - 1
         
         IF tile$(monPos(a)) = "#" THEN
            LET monPos(a) = monPos(a) + 1
         END IF
         
      END IF
     
   END IF
   
   
   
   IF monPos(a) < 9900 THEN
     
      IF monRNDmove = 3 THEN
         LET monPos(a) = monPos(a) + 1
         
         IF tile$(monPos(a)) = "#" THEN
            LET monPos(a) = monPos(a) - 1
         END IF
         
      END IF
     
     
     
      IF monRNDmove = 4 THEN
         LET monPos(a) = monPos(a) + 100
         
         IF tile$(monPos(a)) = "#" THEN
            LET monPos(a) = monPos(a) - 100
         END IF
         
      END IF
     
   END IF
   
   
   LET colA(monPos(a)) = monColA(a)
   LET colB(monPos(a)) = monColB(a)
   LET colC(monPos(a)) = monColC(a)
   LET tile$(monPos(a)) = monChar$(a)
NEXT

CLEAR
PRINT "Press the spacebar key, type lower level then press the enter key to go to the next floor down"
PRINT " "

FOR a = 1 to numberOfMon
   
   IF playerPos = monPos(a) THEN
     
      LET life = life - monAttack(a)
      LET monLife(a) = monLife(a) - attack
     
      PRINT monName$(a) + " attacked you"
      PRINT "Your life is now " + STR$(life)
     
      PRINT "You Attacked " + monName$(a) + " for " + STR$(attack)
     
   END IF
   
NEXT





KEY DOWN

Code: [Select]
IF playerPos > 100 THEN
   
   IF UPKEY = TRUE THEN
      LET playerPos = playerPos - 100
      IF posYcounter < 14 THEN
         LET posYcounter = posYcounter + 1
      END IF
      IF posYcounter = 14 THEN
         LET scrolly = scrolly + 10
      END IF
     
      IF tile$(playerPos) = "#" THEN
         LET playerPos = playerPos + 100
      END IF
     
      GOTOCARD 1
   END IF
   
   IF LEFTKEY = TRUE THEN
      LET playerPos = playerPos - 1
      IF posXcounter > 6 THEN
         LET posXcounter = posXcounter - 1
      END IF
      IF posXcounter = 6 THEN
         LET scrollx = scrollx + 10
      END IF
     
      IF tile$(playerPos) = "#" THEN
         LET playerPos = playerPos + 1
      END IF
     
      GOTOCARD 1
   END IF
   
END IF



IF playerPos < 9900 THEN
   
   IF RIGHTKEY = TRUE THEN
      LET playerPos = playerPos + 1
      IF posXcounter < 14 THEN
         LET posXcounter = posXcounter + 1
      END IF
      IF posXcounter = 14 THEN
         LET scrollx = scrollx - 10
      END IF
     
      IF tile$(playerPos) = "#" THEN
         LET playerPos = playerPos - 1
      END IF
     
      GOTOCARD 1
   END IF
   
   
   
   IF DOWNKEY = TRUE THEN
      LET playerPos = playerPos + 100
      IF posYcounter > 6 THEN
         LET posYcounter = posYcounter - 1
      END IF
      IF posYcounter = 6 THEN
         LET scrolly = scrolly - 10
      END IF
     
      IF tile$(playerPos) = "#" THEN
         LET playerPos = playerPos - 100
      END IF
     
      GOTOCARD 1
   END IF
   
END IF

IF SPACEBARKEY = TRUE THEN
   INPUT
END IF







INPUT

Code: [Select]
IF INPUT$ = "lower level" THEN
   LET newLevel = 0
   GOTOCARD 1
END IF







PAINT

Code: [Select]
LET paintNew = 1
LET fontSize = 12
LET padding = 10
LET tileNum = 0
LET ty = scrolly


FOR j = 1 to 100
   LET ty = ty + padding
   LET tx = scrollx
   FOR a = 1 to 100
      LET tileNum = tileNum + 1
      LET tx = tx + padding
      SETPENCOLOR colA(tileNum), colB(tileNum), colC(tileNum)
      DRAWSTRING tile$(tileNum), tx, ty, "Courier", fontSize
   NEXT
NEXT





Manually putting in that code produced the missing function error.

Johna100


  • GMG-er

  • **


  • Posts: 173

  • lalala
Re: Simple Rougelike project download
« Reply #9 on: August 10, 2020, 08:44:10 PM »
The code looks like it should work.

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Re: Simple Rougelike project download
« Reply #10 on: August 10, 2020, 11:26:59 PM »
The above code is using the function
Code: [Select]
monPos
but doesn't have the function defined.

Johna100


  • GMG-er

  • **


  • Posts: 173

  • lalala
Re: Simple Rougelike project download
« Reply #11 on: August 12, 2020, 12:26:52 PM »
Im not sure how to fix that, the code works on my computer.

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Re: Simple Rougelike project download
« Reply #12 on: August 12, 2020, 01:00:12 PM »
Pasting the function monPos might help if you have it.

Johna100


  • GMG-er

  • **


  • Posts: 173

  • lalala
Re: Simple Rougelike project download
« Reply #13 on: August 12, 2020, 06:33:41 PM »
Could show me how to do that?

Connors


  • ^ This guy is amazing.

  • ****


  • Posts: 2374

  • It's a secret to everyone...
Re: Simple Rougelike project download
« Reply #14 on: August 13, 2020, 10:25:09 PM »
Looks like monPos is not a function, but an array. Is it a scope issue?
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/