Qbasicnews.com

Full Version: I made this engine a few days ago. See what you think.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I made this engine a few days ago. See what you think.

Code:
DECLARE SUB DrawCir ()
DECLARE SUB DrawLevel ()
DECLARE SUB GenBarracade ()

SCREEN 13
RANDOMIZE TIMER

DIM SHARED Direct$, C, D, X, Y, E, F


X = 160
Y = 100

DO:
   DrawCir
  
   DrawLevel
  
   N$ = INKEY$
   IF N$ > "" THEN LINE (152, 92)-(168, 108), 0, BF: LINE (X - C, Y - D)-(X + C, Y + D), 0, B: LINE (X - C + E, Y - D + E)-(X - C + 20 * 1.3333333# + E, Y - D + 20 + E), 0, B
  
   SELECT CASE N$
      CASE CHR$(0) + "H": Direct$ = "U": Y = Y + 5
      CASE CHR$(0) + "K": Direct$ = "L": X = X + 5
      CASE CHR$(0) + "M": Direct$ = "R": X = X - 5
      CASE CHR$(0) + "P": Direct$ = "D": Y = Y - 5
      CASE CHR$(27): END
   END SELECT
  
   GenBarracade

LOOP

1 DATA 93.133333#, 70, 3
2 DATA 10, 50

SUB DrawCir
   CIRCLE (160, 100), 10, , , , .75

   IF Direct$ = "L" THEN
      CIRCLE (155, 98), 2
      PAINT (155, 98), 15, 15
      PSET (154, 98), 0
   END IF

   IF Direct$ = "R" THEN
      CIRCLE (165, 98), 2
      PAINT (165, 98), 15, 15
      PSET (166, 98), 0
   END IF

   IF Direct$ = "D" THEN
      CIRCLE (157, 102), 2
      CIRCLE (163, 102), 2
      PAINT (157, 102), 15, 15
      PAINT (163, 102), 15, 15
      PSET (157, 103), 0
      PSET (163, 103), 0
   END IF

   IF Direct$ = "U" THEN
      CIRCLE (157, 97), 2
      CIRCLE (163, 97), 2
      PAINT (157, 97), 15, 15
      PAINT (163, 97), 15, 15
      PSET (157, 96), 0
      PSET (163, 96), 0
   END IF

   PAINT (160, 100), 1, 15

END SUB

SUB DrawLevel
  
   RESTORE 1
   READ C, D, E, F
   LINE (X - C, Y - D)-(X + C, Y + D), , B
  
END SUB

SUB GenBarracade

IF X - 10 < (160 - C) THEN X = X + 5: SOUND 300, .25: SOUND 100, .75
IF X + 10 > (160 + C) THEN X = X - 5: SOUND 300, .25: SOUND 100, .75

IF Y - 9.75 < (100 - D) THEN Y = Y + 5: SOUND 300, .25: SOUND 100, .75
IF Y + 9.75 > (100 + D) THEN Y = Y - 5: SOUND 300, .25: SOUND 100, .75

END SUB

SUB ReadLevel

END SUB

So, what do you think? Maybe someone could make a game with it? Maybe it could be a challenge...
I'm not sure what to think. It's really basic, but if you can make something of it then go right ahead.
Nice. Suggestion: when the guy is going up, make no eyeballs on it. :wink:
Oh if only QB would work in XP on this machine.. I hate having to go offline and reconnect everytime I switch to 98. Not to mention 98 is running like a box of crap at the moment.
ok DUDE! XP shits on QB, but you can still make it work in it. I use XP and QB works fine so Tongue , and I have Home + Pro.
So, who wants to make a game with it? I have no ideas, and my coding is bad. But, maybe some sort of RPG? :???:
Oh well, guess it's time to download QB again. In fb i get expected = on line 84. CURSE YOU FB (odd, only a few days ago i was cursing QB)

[edit] Thats quite basic, it isn't that bad, maybe a rpg or pakman style game, my engines are even worse though, so i can't really say anything. [/edit]
Quote:Oh well, guess it's time to download QB again. In fb i get expected = on line 84. CURSE YOU FB (odd, only a few days ago i was cursing QB)

[edit] Thats quite basic, it isn't that bad, maybe a rpg or pakman style game, my engines are even worse though, so i can't really say anything. [/edit]

Eh? Yeah, I tried it to. There is the SOUND stament on that line.. but REMing its no-good, something else in the code doesn't work in FB,. every thing gets gumbled..

@ j2krei08
Cool lil dude BTW.. :wink:
Cool. Keep the URL. Great demo for newbies trying to figure out how to make the arrow keys, sound, etc. work.

Mac