Topic:   Text Tile Map in the text field that has player movement   (Read 2680 times)


0 Members and 1 Guest are viewing this topic.

Johna100


  • GMG-er

  • **


  • Posts: 173

  • lalala
Text Tile Map in the text field that has player movement
« on: June 15, 2020, 04:43:15 PM »
Global Scripting

Open Game


Code: [Select]
DIM world(600000)
DIM tile$(600000)
DIM display$(1000)
DIM tileView(600000)
DIM t(1000)

FOR a = 1 to 600000
   LET world(a) = RANDOM(15)
NEXT

FOR a = 1 to 600000
   IF world(a) = 1 THEN
      LET tile$(a) = "."
   END IF
   IF world(a) = 2 THEN
      LET tile$(a) = "."
   END IF
   IF world(a) = 3 THEN
      LET tile$(a) = "."
   END IF
   IF world(a) = 4 THEN
      LET tile$(a) = "."
   END IF
   IF world(a) = 5 THEN
      LET tile$(a) = "."
   END IF
   IF world(a) = 6 THEN
      LET tile$(a) = "."
   END IF
   IF world(a) = 7 THEN
      LET tile$(a) = "."
   END IF
   IF world(a) = 8 THEN
      LET tile$(a) = "."
   END IF
   IF world(a) = 9 THEN
      LET tile$(a) = "."
   END IF
   IF world(a) = 10 THEN
      LET tile$(a) = "."
   END IF
   IF world(a) = 11 THEN
      LET tile$(a) = "."
   END IF
   IF world(a) = 12 THEN
      LET tile$(a) = "."
   END IF
   IF world(a) = 13 THEN
      LET tile$(a) = "."
   END IF
   IF world(a) = 14 THEN
      LET tile$(a) = "t"
   END IF
   IF world(a) = 15 THEN
      LET tile$(a) = "T"
   END IF
NEXT
















Card 1 Scripting

Open Card



Code: [Select]
LET i = 0
LET row = 0
FOR c = 1 to 30
   LET row = row + 1000
   FOR a = 1 to 30
      LET i = i + 1
      LET screenView = screenPos + row
      LET tileView(i) = screenView + a
      LET display$(i) = tile$(tileView(i))
   NEXT
NEXT

LET display$(195) = "P"


SETFIELDFONT "Courier"
SETFIELDCOLOR 0, 0, 0
SETFIELDSIZE 12
LET tRow = 0
FOR b = 1 to 10
   LET tRow = tRow + 30
   FOR a = 1 to 30
      LET t(a) = a + tRow
   NEXT
   PRINT display$(t(1)) + display$(t(2)) + display$(t(3)) + display$(t(4)) + display$(t(5)) + display$(t(6)) + display$(t(7)) + display$(t(8)) + display$(t(9)) + display$(t(10)) + display$(t(11)) + display$(t(12)) + display$(t(13)) + display$(t(14)) + display$(t(15)) + display$(t(16)) + display$(t(17)) + display$(t(18)) + display$(t(19)) + display$(t(20)) + display$(t(21)) + display$(t(22)) + display$(t(23)) + display$(t(24)) + display$(t(25)) + display$(t(26)) + display$(t(27)) + display$(t(28)) + display$(t(29)) + display$(t(30))
NEXT

















Key Down

Code: [Select]
IF screenPos > 1000 THEN
   
   IF UPKEY = TRUE THEN
      IF display$(165) = "." THEN
         LET screenPos = screenPos - 1000
      END IF
   END IF
   
   IF LEFTKEY = TRUE THEN
      IF display$(194) = "." THEN
         LET screenPos = screenPos - 1
      END IF
   END IF
END IF


IF screenPos < 500000 THEN
   
   IF DOWNKEY = TRUE THEN
      IF display$(225) = "." THEN
         LET screenPos = screenPos + 1000
      END IF
   END IF
   
   IF RIGHTKEY = TRUE THEN
      IF display$(196) = "." THEN
         LET screenPos = screenPos + 1
      END IF
   END IF
END IF

GOTOCARD 1













« Last Edit: June 17, 2020, 04:04:01 AM by Johna100 »

Johna100


  • GMG-er

  • **


  • Posts: 173

  • lalala
Re: Text Tile Map in the text field that has player movement
« Reply #1 on: June 15, 2020, 04:44:34 PM »
It takes some time to load when you run the game but the world is large.

Johna100


  • GMG-er

  • **


  • Posts: 173

  • lalala
Re: Text Tile Map in the text field that has player movement
« Reply #2 on: June 15, 2020, 04:46:27 PM »
The display is in the text field. I could not get this style of game to work in the paint screen. Since its in the text field it has no colors. I think it still achieves the goal.
« Last Edit: June 16, 2020, 03:28:38 AM by Johna100 »

Johna100


  • GMG-er

  • **


  • Posts: 173

  • lalala
Re: Text Tile Map in the text field that has player movement
« Reply #3 on: June 16, 2020, 03:17:13 AM »
EDIT: Im going to post the editable project file when the game is completed. Rather than posting tons of posts with many lines of code.

--------

I have 900 goblins that move independently every turn the player moves. I will post the code when I have them able to attack the player.
« Last Edit: June 16, 2020, 07:13:46 AM by Johna100 »

GMG Mike


  • Administrator

  • GMG-er

  • *****

  • no avatar

  • Posts: 536
    • mikerichardson.name
Re: Text Tile Map in the text field that has player movement
« Reply #4 on: June 27, 2020, 01:31:48 AM »
Wow I've never tried a DIM that large!

It should work fine though. Even a "DIM world(600000)" would only use 600000 x 8 bytes of memory, or about 4.6 MB. (Because SilverCreator numbers are always decimal numbers - also known as double precision, and so they use 8 bytes each.)


Johna100


  • GMG-er

  • **


  • Posts: 173

  • lalala
Re: Text Tile Map in the text field that has player movement
« Reply #5 on: July 02, 2020, 07:07:34 AM »
I have made mountain ranges and forests that are randomly generated