Weekly Qbasic and Qb64 Lesson Topics
March 28, 2024, 05:25:32 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  

PacMan2f This one moves with arrow keys

Pages: 1 2 [3] 4
  Print  
Author Topic: PacMan2f This one moves with arrow keys  (Read 3611 times)
guest
Guest
« Reply #30 on: March 15, 2011, 07:31:41 am »


    Here's a demo with your ghosts Garry. I reduced the overall size of the graphic sheet to 800,200. This makes each individual graphic 200 x 200.
Here the link to the graphic:http://dl.dropbox.com/u/10291175/GhostBlue1.rar
Code:
REM
DEFLNG A-Z

Sprite& = _LOADIMAGE("GhostBlue1.bmp", 32)
Video& = _NEWIMAGE(800, 600, 32)

SCREEN Video&
_PUTIMAGE (50, 199)-(750, 399), Sprite&, Video&
LINE (50, 199)-(750, 399), _RGB32(255, 255, 0), B
PAINT (10, 10), _RGB32(255, 255, 255)
x = 10: y = 10: State = 1

DO
  _LIMIT 100

  _PUTIMAGE (50, 199)-(750, 399), Sprite&, Video&
  LINE (50, 199)-(750, 399), _RGB32(255, 255, 0), B

  SELECT CASE State
    CASE IS = 1
      x = x + 1
      IF x >= 750 THEN
        x = 750: State = 2
      END IF
      _PUTIMAGE (x, y)-(x + 40, y + 40), Sprite&, Video&, (0, 0)-(199, 199)
    CASE IS = 2
      y = y + 1
      IF y >= 550 THEN
        y = 550: State = 3
      END IF
      _PUTIMAGE (x, y)-(x + 40, y + 40), Sprite&, Video&, (200, 0)-(399, 199)
    CASE IS = 3
      x = x - 1
      IF x <= 10 THEN
        x = 10: State = 4
      END IF
      _PUTIMAGE (x, y)-(x + 40, y + 40), Sprite&, Video&, (400, 0)-(599, 199)
    CASE IS = 4
      y = y - 1
      IF y <= 10 THEN
        y = 10: State = 1
      END IF
      _PUTIMAGE (x, y)-(x + 40, y + 40), Sprite&, Video&, (600, 0)-(799, 199)
  END SELECT

  _DISPLAY
LOOP UNTIL _KEYDOWN(27)
SLEEP
SYSTEM

« Last Edit: September 17, 2011, 09:53:09 am by GarrisonRicketson » Report Spam   Logged

Pages: 1 2 [3] 4
  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