Weekly Qbasic and Qb64 Lesson Topics
April 19, 2024, 01:42:04 pm
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 1780 times)
GarrisonRicketson
Admin
Administrator
Hero Member
*****
Posts: 583



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


Pages: [1] 2
  Print  
 
Jump to:  

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


Powered by SMF | SMF © 2016, Simple Machines
Privacy Policy