Weekly Qbasic and Qb64 Lesson Topics
October 24, 2017, 06:20:41 am
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Want to see a specific Tutorial? ASK!
 
  Home Help Search Arcade Links Staff List Login Register  

[DISCUSSION] Very Simple Game engine


Pages: [1] 2
  Print  
Author Topic: [DISCUSSION] Very Simple Game engine  (Read 1299 times)
guest
Guest
« on: June 19, 2011, 12:29:20 am »


    Here is the start and proof of concept of a very simple graphic engine for a game.
The graphic:
http://dl.dropbox.com/u/10291175/RogueCraftExp1.bmp
The code:
Code:
REM  'RogueCraft Proof of Concept.
DEFINT A-Z

SCREEN _NEWIMAGE(640, 480, 32) 'what the user will see
Tiles1& = _LOADIMAGE("RogueCraftExp1.bmp", 32) 'hidden window of our tiles 8 tiles@(16 x 16)

DIM Map%(40, 30)
GOSUB LoadMap
GOSUB ShowMap

DO
  _LIMIT 30



  _DISPLAY
LOOP UNTIL _KEYDOWN(27)
SLEEP
SYSTEM

'---------------------  gosubs  -------------------------------
LoadMap:
FOR col = 0 TO 29
  FOR row = 0 TO 39
    READ z
    Map%(row, col) = z
  NEXT row
NEXT col
RETURN

ShowMap:
FOR col = 0 TO 29
  FOR row = 0 TO 39
    SELECT CASE Map%(row, col)
      CASE 0
        _PUTIMAGE (row * 16, col * 16)-((row * 16) + 15, (col * 16) + 15), Tiles1&, 0, (0, 0)-(15, 15)
      CASE 1
        _PUTIMAGE (row * 16, col * 16)-((row * 16) + 15, (col * 16) + 15), Tiles1&, 0, (16, 0)-(31, 15)
      CASE 2
        _PUTIMAGE (row * 16, col * 16)-((row * 16) + 15, (col * 16) + 15), Tiles1&, 0, (32, 0)-(47, 15)
      CASE 3
        _PUTIMAGE (row * 16, col * 16)-((row * 16) + 15, (col * 16) + 15), Tiles1&, 0, (48, 0)-(63, 15)
      CASE 4
        _PUTIMAGE (row * 16, col * 16)-((row * 16) + 15, (col * 16) + 15), Tiles1&, 0, (64, 0)-(79, 15)
      CASE 5
        _PUTIMAGE (row * 16, col * 16)-((row * 16) + 15, (col * 16) + 15), Tiles1&, 0, (80, 0)-(95, 15)
      CASE 6
        _PUTIMAGE (row * 16, col * 16)-((row * 16) + 15, (col * 16) + 15), Tiles1&, 0, (96, 0)-(111, 15)
      CASE 7
        _PUTIMAGE (row * 16, col * 16)-((row * 16) + 15, (col * 16) + 15), Tiles1&, 0, (112, 0)-(127, 15)
    END SELECT
  NEXT row
NEXT col
RETURN


'----------------------------------------- MAP  40 x 30  -----------------------------
'Tiles are 0,1,2,3,4,5,6,7
'    *1                *10                 *20                 *30                 *40
DATA 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7
DATA 7,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,7
DATA 7,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,7
DATA 7,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,7
DATA 7,1,1,1,3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,7
DATA 7,1,1,1,1,3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,7
DATA 7,1,1,1,1,1,3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,7
DATA 7,1,1,1,1,1,1,3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,7
DATA 7,1,1,1,1,1,1,1,3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1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,1,1,1,1,7
DATA 7,1,1,1,1,1,5,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,7
DATA 7,1,1,1,1,1,5,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,7
DATA 7,1,1,1,5,5,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,7
DATA 7,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,7
DATA 7,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,7
DATA 7,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,7
DATA 7,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,7
DATA 7,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,7
DATA 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7
Look over it and suggest some improvements to speed it up , etc.
« Last Edit: September 07, 2011, 08:40:19 am by GarrisonRicketson » Report Spam   Logged

Social Buttons

Unseen Machine
Post Demos
*
Posts: 46


« Reply #1 on: June 20, 2011, 07:51:37 am »

For speed, allways (where possible use Integers) so Col and Row should be Col%, Row%.

Code:
LoadMap:
FOR col = 0 TO 29
  FOR row = 0 TO 39
    READ z
    Map%(row, col) = z
  NEXT row
NEXT col
RETURN

Or if you want it lightning fast you could allways just GDK it. Wink

Code:
CHDIR "d:\qb64\Other Peoples Demos\RogueCraft" '// CHANGE TO WHERE YOU PUT THE FILES

GDK_Start
GDK_Screen_SetRes GameScreen, 640, 480, 32, 0

DIM KB AS KeyBoardState

DIM TileSheet AS Tileset, TileSheetXY(1 TO 8) AS XY, Level(40, 30) AS Tile
GDK_Tileset_New TileSheet, "RogueCraftExp1.bmp", TileSheetXY(), 8, 1, _RGB(0, 0, 0), 0, 0
GDK_TileMap_Load Level(), 40, 30

DO
  _LIMIT 24
  CLS
  GDK_Keyboard_GetState KB
  IF KB.ESC THEN SYSTEM

  GDK_Tiles_Draw TileSheet, TileSheetXY(), Level(), 0, 0, 0, 0, 40, 30

  _DISPLAY
LOOP


REM $INCLUDE:'UnseenGDK.bm'


DATA 7,1,7,1,7,1,7,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,7
DATA 1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
DATA 1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
DATA 1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
DATA 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
DATA 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
DATA 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
DATA 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1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,1,1,1,1,1,1,1
DATA 1,1,1,1,1,1,5,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,5,1,1,1,1,1,1,1,1,1,1,1,1
DATA 1,1,1,1,1,1,5,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
DATA 1,1,1,1,1,1,5,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
DATA 1,1,1,1,5,5,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
DATA 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
DATA 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
DATA 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
DATA 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
DATA 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
DATA 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1

John

Report Spam   Logged
Unseen Machine
Post Demos
*
Posts: 46


« Reply #2 on: June 20, 2011, 11:18:55 am »

DEFINT A-Z

I allways thought this will make all the variables A,B,C,D, etc... integers, and had no impact on Col or Row which to me, are single precision in your code. Now i know better, thanks for teaching me that.

Unseen

Report Spam   Logged
calkiot
Guest
« Reply #3 on: June 21, 2011, 08:52:43 pm »

Oooh, I'm glad my needs for teaching can hopefully help other people. 'RogueCraft' ^^ I feel good now!
Report Spam   Logged
calkiot
Guest
« Reply #4 on: June 22, 2011, 05:08:18 pm »

Thats deep, but very true. We all have a purpose in life. And everyone puts there mark on society. But I want this one to stand out. 
Report Spam   Logged
guest
Guest
« Reply #5 on: June 24, 2011, 11:58:15 am »


    Here's proof of concept of the VSGE Editor that creates a file containing data statements to include in the engine program.
The graphic:
http://dl.dropbox.com/u/10291175/RogueCraftExp1.bmp
The code:

Code:
REM
DEFINT A-Z

_TITLE "VSGE Editor" '                                           our window title
SCREEN _NEWIMAGE(800, 600, 32) '                                 screen the user sees

DIM Map%(40, 30) '                                               structure to hold the map data inmemory
DIM SHARED mx%, my%, mbl%, mbr% '                                structure for mouse x y left and right buttons
DIM Tints&(8) '                                                  structure for the 8 colors numbers

Tiles1& = _LOADIMAGE("RogueCraftExp1.bmp", 32) '                 hidden window of our tiles 8 tiles@(16 x 16)

IF Tiles1& <> 0 THEN '                                           error trap for unfound file
  PRINT "Graphic file loaded"; Tiles1&
ELSE
  PRINT "Unable to locate graphic file RougeCraftExp1.bmp"
  _DELAY 3
  END
END IF


Grey& = _RGB32(192, 192, 192)
Pink& = _RGB32(255, 105, 180)
LWhite& = _RGB32(255, 250, 250)

GOSUB Box
GOSUB Grid
GOSUB ShowTiles

TileNum = 0: Savfilename$ = "VSGE-Data.txt": CanSave = 0
_MOUSESHOW


DO
  _LIMIT 30
  GOSUB MicePoll
  GOSUB FindPlace
  IF _KEYDOWN(115) THEN GOSUB PrepareSave 'S button to save
  IF Region = 2 THEN GOSUB InRegion2
  IF Region = 1 THEN GOSUB InRegion1
  LOCATE 34, 1: PRINT "Tile", "Region="; Region, "TileNum="; TileNum, cellx, celly
  LOCATE 35, 1: PRINT "MiceX="; mx%, "MiceY="; my%; "        "
  _DISPLAY
LOOP UNTIL _KEYDOWN(27)

SLEEP
SYSTEM

'------------------------------------- GOSUBS ------------------------------------
Box:
LINE (7, 7)-(649, 489), Grey&, BF '         main window
LINE (663, 7)-(680, 136), Grey&, BF '       tile selection window
LINE (698, 6)-(739, 39), Grey&, BF '        mini map
RETURN

Grid:
FOR x = 8 TO 647 STEP 16 '                  main paste window grid
  FOR y = 8 TO 487 STEP 16
    LINE (x, y)-(x + 15, y + 15), Pink&, B
  NEXT y
NEXT x
x = 664: y = 8
FOR Tile = 0 TO 7 '                         tile selection window grid
  LINE (x, y)-(x + 15, y + 15), Pink&, B
  y = y + 16
NEXT Tile
RETURN

ShowTiles:
x1 = 664: y1 = 8: x2 = 0: y2 = 0 '           show tiles zero to seven = 8 tiles total
FOR Tile = 0 TO 7 '
  LINE (x1, y1)-(x1 + 15, y1 + 15), Pink&, B
  _PUTIMAGE (x1, y1)-(x1 + 15, y1 + 15), Tiles1&, 0, (x2, y2)-(x2 + 15, y2 + 15)
  y1 = y1 + 16
  x2 = x2 + 16
NEXT Tile
GOSUB MakeColors '                           'probe the color of the tiles + save to array
RETURN

FindPlace:
Region = 0
IF mx% >= 8 THEN
  IF mx% <= 647 THEN
    IF my% >= 8 THEN
      IF my% <= 487 THEN
        Region = 1 'main draw window
      END IF
    END IF
  END IF
END IF

IF mx% >= 664 THEN
  IF mx% <= 679 THEN
    IF my% >= 8 THEN
      IF my% <= 135 THEN
        Region = 2 'main tile window
      END IF
    END IF
  END IF
END IF
RETURN

MicePoll:
DO WHILE _MOUSEINPUT
  mx% = _MOUSEX: my% = _MOUSEY: mbl% = _MOUSEBUTTON(1): mbr% = _MOUSEBUTTON(2)
LOOP
RETURN

InRegion1:
micex = mx% - 8: MiceY = my% - 8 '    correct the offset from the left of the screen
cellx = micex \ 16 '                  divide by 16 to get cell
celly = MiceY \ 16 '                  divide by 16 to get cell
pastex1 = (cellx * 16) + 8: pastex2 = pastex1 + 15: pastey1 = (celly * 16) + 8: pastey2 = pastey1 + 15 'paste refers to place to paste
IF mbl% = -1 THEN
  _PUTIMAGE (pastex1, pastey1)-(pastex2, pastey2), Tiles1&, 0, (copyx1, copyy1)-(copyx2, copyy2)
  Map%(cellx, celly) = TileNum '      assign tile number
  GOSUB ShowMiniDim '                 update mini window
END IF
RETURN

InRegion2:
IF mbl% = -1 THEN
  SELECT CASE my%
    CASE 8 TO 23
      TileNum = 0
      copyx1 = 0: copyy1 = 0: copyx2 = copyx1 + 15: copyy2 = copyy1 + 15 'the source image co-ordinates for putimage
    CASE 24 TO 39
      TileNum = 1
      copyx1 = 16: copyy1 = 0: copyx2 = copyx1 + 15: copyy2 = copyy1 + 15
    CASE 40 TO 55
      TileNum = 2
      copyx1 = 32: copyy1 = 0: copyx2 = copyx1 + 15: copyy2 = copyy1 + 15
    CASE 56 TO 71
      TileNum = 3
      copyx1 = 48: copyy1 = 0: copyx2 = copyx1 + 15: copyy2 = copyy1 + 15
    CASE 72 TO 87
      TileNum = 4
      copyx1 = 64: copyy1 = 0: copyx2 = copyx1 + 15: copyy2 = copyy1 + 15
    CASE 88 TO 103
      TileNum = 5
      copyx1 = 80: copyy1 = 0: copyx2 = copyx1 + 15: copyy2 = copyy1 + 15
    CASE 103 TO 119
      TileNum = 6
      copyx1 = 96: copyy1 = 0: copyx2 = copyx1 + 15: copyy2 = copyy1 + 15
    CASE 120 TO 135
      TileNum = 7
      copyx1 = 112: copyy1 = 0: copyx2 = copyx1 + 15: copyy2 = copyy1 + 15
  END SELECT
  _PUTIMAGE (10, 500)-(26, 516), Tiles1&, 0, (copyx1, copyy1)-(copyx2, copyy2)
END IF
RETURN

ShowMiniDim:
x = 699: y = 7
FOR across = 0 TO 29 '39
  FOR down = 0 TO 39 '29
    z = Map%(down, across) '                             ->across ,down
    PSET (699 + down, 8 + across), Tints&(z) '           ->across ,down
    'LOCATE across + 1, down + 1: PRINT LTRIM$(STR$(z)) ' ->across ,down
  NEXT down
NEXT across
CanSave = 1
RETURN

MakeColors:
count = 0
FOR T = 16 TO 130 STEP 16
  Hue& = POINT(675, T)
  Tints&(count) = Hue&
  count = count + 1
NEXT T
RETURN

PrepareSave:
'convert onscreen to DATA statements
temp$ = "": LOCATE 20, 20: PRINT "SAVING FILE": _DISPLAY: _DELAY 1
FOR across = 0 TO 29 '39
  FOR down = 0 TO 39 '29
    z = Map%(down, across)
    z$ = STR$(z): z$ = LTRIM$(z$)
    temp$ = temp$ + z$ + ","
  NEXT down
  GOSUB SavTxt
  temp$ = ""
NEXT across
LOCATE 20, 10: PRINT "FILE HAS BEEN SAVED AS VSGE-Data.txt": _DISPLAY: _DELAY 1
SYSTEM
RETURN

SavTxt:
z = LEN(temp$)
temp$ = LEFT$(temp$, z - 1)
temp$ = "DATA " + temp$
OPEN Savfilename$ FOR APPEND AS #1
PRINT #1, temp$
CLOSE #1
RETURN
« Last Edit: September 07, 2011, 08:42:27 am by GarrisonRicketson » Report Spam   Logged
GarrisonRicketson
Admin
Administrator
Hero Member
*****
Posts: 583



WWW
« Reply #6 on: June 30, 2011, 08:07:43 pm »

 I just now finaly got around to trying this,..I made a "box" with a face in it ?
That is some thing in the "game maker program" they have a sprite editor,  and also for when you design or make a "room"...but this is going to be with qb64,
 The biggest problem I had with "game maker" is, they have a few pre made scripts you can use, for collisions, etc,..and they do have a editor to edit the scripts, but the code is not qbasic,...And I couldn't make any sense of it, So they have a forum, where you can not only get more tuts, but even scripts,..The "catch" is if you don't pay for the program and register it,..you cant join the forum,..( at least that was how it appeared to me ),...so any way, With qb64, it is  possible, to make a similar program, or "game engine", ...just a matter of time,effort,and patience...
 I like the direction this is going,..
from Garry
Report Spam   Logged

GarrisonRicketson
Admin
Administrator
Hero Member
*****
Posts: 583



WWW
« Reply #7 on: July 01, 2011, 12:15:05 am »

Ok, thanks,..
  Well, I can not say I understand everything, but the most recent code seems to work well, and I see how it , can make "blocks",..as I did, I made a "box", with other blocks filed in on the inside, and all the blocks in the grid show the cooridinates,, so I have an idea of how it can be useful,..
I hit S, and it said saved, but I actually have not checked yet to see if a file was saved, I got side tracked,...My comparison, to "game maker", may be seem inappropriate, but not really, all though it is a entire program, it reall is esentially just a game engine, with lots of "tools",...much more complex, and I do not understand much about it (game maker),..these,(what you are demonstrateing)are Very Simple Game Engine, editors, I need to wait and see, I did not get any option, to name the file it saved, but I noticed in the code, where it saves the file, so I suppose one could modify that, to use a differnt name ? Or are you working on that ? I guess thats what I am trying to say, it may be a little early, to start asking any questions, on this...but thanks, you can be sure I will,...when I also, figure out how to word the specific questions,...I said a similar thing to Quark, ...at this point, I haven't really figured out the "wording" for some questions I have, on his presenter tut,...
Hope I make sense ?
And thanks,from Garry
Report Spam   Logged

GarrisonRicketson
Admin
Administrator
Hero Member
*****
Posts: 583



WWW
« Reply #8 on: July 07, 2011, 08:12:52 pm »

Quote
The editor produces a file that is composed of DATA STATEMENTS. The end user opens that file , highlights all the lines and copies them into the QB64 editor , replacing the map inside the VSGE. So your new map replaces the pre made original map.   
Ok. I understood, pretty much, that that was what was supposed to do,..but when I went to see how my VSGE-data.txt file came out it is "blank", all zeros....
Code:
  DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
 
I know you may say, well thats cause you ran the .bas again, with out any thing "drawn" or painted,..but I didn't,...in the mean while, I am going to try again,
Quote
So your new map replaces the pre made original map 
, something may have happened, that caused it overwrite, that I did not notice,..
thanks, Later, from Garry
Important ! 
Note, EDIT,..I tried again, and it did save ok,..So That part is worked out,not sure what happened the first times,  I don't see any point in posting the data file though,...
from Garry
 
« Last Edit: July 07, 2011, 09:08:35 pm by GarrisonRicketson » Report Spam   Logged

GarrisonRicketson
Admin
Administrator
Hero Member
*****
Posts: 583



WWW
« Reply #9 on: July 07, 2011, 09:17:49 pm »

Just copy and paste to your qb64 editor, adjust the dir path as needed,.
Useing the GDK, version Unseen posted, pretty cool ,...
Code:
  'CHDIR "d:\qb64\Other Peoples Demos\RogueCraft" '// CHANGE TO WHERE YOU PUT THE FILES
'My Face, useing Unseens GDK version
GDK_Start
GDK_Screen_SetRes GameScreen, 640, 480, 32, 0

DIM KB AS KeyBoardState

DIM TileSheet AS Tileset, TileSheetXY(1 TO 8) AS XY, Level(40, 30) AS Tile
GDK_Tileset_New TileSheet, "RogueCraftExp1.bmp", TileSheetXY(), 8, 1, _RGB(0, 0, 0), 0, 0
GDK_TileMap_Load Level(), 40, 30

DO
    _LIMIT 24
    CLS
    GDK_Keyboard_GetState KB
    IF KB.ESC THEN SYSTEM

    GDK_Tiles_Draw TileSheet, TileSheetXY(), Level(), 0, 0, 0, 0, 40, 30

    _DISPLAY
LOOP


REM $INCLUDE:'UnseenGDK.bm'

DATA 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5
DATA 5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5
DATA 5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5
DATA 5,0,0,0,5,5,5,5,5,5,5,0,0,0,0,0,0,0,5,5,5,5,5,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5
DATA 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5

 
Now what ?
from Garry
Report Spam   Logged

GarrisonRicketson
Admin
Administrator
Hero Member
*****
Posts: 583



WWW
« Reply #10 on: July 08, 2011, 08:08:50 am »

The code I used, is right here in this thread,...

http://weeklyqbasicandqb64lesson.smfforfree.com/index.php/topic,217.0/msg,1188.html
no one sent it to me,  and I do not claim to have written it. Unseen wrote it,  and posted it .Used the
VSGE editor to make the data statements,....
 I then put the data staments into the code, at the bottom,...
  Now what ?,.. thats all I was wondering, now what next, or thinking out loud, What am I going to do next,..

I have to run now, it is time to go to work,..

from Garry


Report Spam   Logged

GarrisonRicketson
Admin
Administrator
Hero Member
*****
Posts: 583



WWW
« Reply #11 on: July 08, 2011, 06:20:42 pm »

Ok, thats pretty much what I had in mind too,...
From what I can understand, is we can use the VSGE editor, and make either one image, or various images, then useing the data statements, and _putimage, place those images in various parts of the screen, then useing case statements, and other code, pehaps one image moves, another is like a "room" or could be a maze,.
another might be a target, or a enemy.?
anyway after I go over the ,explanations more, and try some  more things with the code,..
  also I appreciate all your efforts, and I am sure others do too.
from Garry
Report Spam   Logged

GarrisonRicketson
Admin
Administrator
Hero Member
*****
Posts: 583



WWW
« Reply #12 on: July 08, 2011, 08:50:37 pm »

Ok, I did insert my data statements, into, your "proof of concept" code,..also read ,the posts in the other thread,
http://weeklyqbasicandqb64lesson.smfforfree.com/index.php/topic,221.0/msg,1218.html
..it all seems easy enough to understand,...
-----------------------Code Below--------------
Code:
 REM  'VSGE Proof of Concept.
DEFINT A-Z

SCREEN _NEWIMAGE(640, 480, 32) 'what the user will see
Tiles1& = _LOADIMAGE("RogueCraftExp1.bmp", 32) 'hidden window of our tiles 8 tiles@(16 x 16)

DIM Map%(40, 30)
GOSUB LoadMap
GOSUB ShowMap

DO
    _LIMIT 30



LOOP UNTIL _KEYDOWN(27)
SLEEP
SYSTEM

'---------------------  gosubs  -------------------------------
LoadMap:
FOR down = 0 TO 29 'col 29
    FOR across = 0 TO 39 'row 39
        READ z
        Map%(across, down) = z 'row,col
    NEXT across
NEXT down
RETURN

ShowMap:
FOR down = 0 TO 29
    FOR across = 0 TO 39
        SELECT CASE Map%(across, down)
            'CASE 0
            '_PUTIMAGE (across * 16, down * 16)-((across * 16) + 15, (down * 16) + 15), Tiles1&, 0, (0, 0)-(15, 15)   '///NOTE: I remarked this line out because I did not want the greenish background
            CASE 1
                _PUTIMAGE (across * 16, down * 16)-((across * 16) + 15, (down * 16) + 15), Tiles1&, 0, (16, 0)-(31, 15)
            CASE 2
                _PUTIMAGE (across * 16, down * 16)-((across * 16) + 15, (down * 16) + 15), Tiles1&, 0, (32, 0)-(47, 15)
            CASE 3
                _PUTIMAGE (across * 16, down * 16)-((across * 16) + 15, (down * 16) + 15), Tiles1&, 0, (48, 0)-(63, 15)
            CASE 4
                _PUTIMAGE (across * 16, down * 16)-((across * 16) + 15, (down * 16) + 15), Tiles1&, 0, (64, 0)-(79, 15)
            CASE 5
                _PUTIMAGE (across * 16, down * 16)-((across * 16) + 15, (down * 16) + 15), Tiles1&, 0, (80, 0)-(95, 15)
            CASE 6
                _PUTIMAGE (across * 16, down * 16)-((across * 16) + 15, (down * 16) + 15), Tiles1&, 0, (96, 0)-(111, 15)
            CASE 7
                _PUTIMAGE (across * 16, down * 16)-((across * 16) + 15, (down * 16) + 15), Tiles1&, 0, (112, 0)-(127, 15)
        END SELECT
    NEXT across
NEXT down
RETURN


'----------------------------------------- MAP  40 x 30  -----------------------------
'Tiles are 0,1,2,3,4,5,6,7
'    *1                *10                 *20                 *30              *40
DATA 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5
DATA 5,0,0,0,0,0,0,0,0,0,0,0,0,0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,0,0,0,0,0,0,0,0,0,5
DATA 5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5
DATA 5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5
DATA 5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5
DATA 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5

  
You will note in the  "CASE 0" line, I remarked both lines out, this was because, with that line it had a kind of olive green back ground, and I did not want that, I want the black back ground.
  In the "code "  thread, you mention as a reference, PacMan, and a ghost. Later I can make a data map, with a pac man and a ghost, and a maze,...
   Ok well guess thats about it, you have done a good job on this,.. So far it dose not sound that complicated.
Guess that is about it for now from Garry
« Last Edit: July 09, 2011, 04:41:52 pm by GarrisonRicketson » Report Spam   Logged

nonexistant person
Guest
« Reply #13 on: July 08, 2011, 09:02:02 pm »


Quote
You will note in the  "CASE 0" line, I remarked both lines out, this was because, with that line it had a kind of olive green back ground, and I did not want that, I want the black back ground.
  In the "code "  thread, you mention as a reference, PacMan, and a ghost. Later I can make a data map, with a pac man and a ghost, and a maze,...
    Good! Now you see how i created this so if the user accepts my fixed limits he can modify it to suit what he wants. Yes you could make a pac man game with the engine. This is a building block that allows you to experiment. The fact that you remmed out the tile you dont like is good in the sense you must understand what it is you want to change and where it is that has to be changed. Which means that you understand it to do that! Once again this is positive feedback. Eventually when this program is outgrown by the user he woukd move up to the GDK and take his understanding with him.
 
« Last Edit: September 08, 2011, 11:49:11 pm by GarrisonRicketson » Report Spam   Logged
Unseen Machine
Post Demos
*
Posts: 46


« Reply #14 on: July 09, 2011, 12:37:31 pm »

The fact that you can tell it to not draw the tile makes it more flexible than GDK, you would have to change the entire DATA block to make it black. That flexibility comes at a price though, execution speed(GDK tile engine does not use select case, it uses pre calc's) and expansion (make the tile sheet 24 * 10 tiles) and then enjoy typing all those cases (all 240 of em!). These are no bad things though as OlDos has clearly stated that simplicity is the aim with VSGE, not functionality.

When i complete GDK2, it will be easier to use than the current version, but not by much Cheesy. GDK2 is aimed at SPEED and minmising memory footprint! A real headache so far i can tell ya. On that note, how much of the keyboard have you added to the type and sub OlDos? Any chance you could post your latest version? I will do what left as i need to add it to GDK2.

Keep up the good work gang,

John

Report Spam   Logged

Pages: [1] 2
  Print  
 
Jump to:  

Powered by EzPortal
Bookmark this site! | Upgrade This Forum
SMF For Free - Create your own Forum

Buy traffic for your forum/website
traffic-masters
Powered by SMF | SMF © 2016, Simple Machines