Weekly Qbasic and Qb64 Lesson Topics
October 12, 2024, 08:51:31 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  

GarrysPacMan, useing putimage

Pages: [1]
  Print  
Author Topic: GarrysPacMan, useing putimage  (Read 617 times)
GarrisonRicketson
Admin
Administrator
Hero Member
*****
Posts: 583



WWW
« on: February 22, 2011, 06:36:54 am »

This is just a simple animation, useing 2 frames, of a 4 frame sprite sheet,.
You need the sprite sheet, for the image,
http://dl.dropbox.com/u/15387474/SprtSheet.PNG
Code:
    REM GarrysPacMan
DEFLNG A-Z

SCREEN _NEWIMAGE(640, 480, 32) 'our new 32bit screen!

WorkPage& = _LOADIMAGE("SPRTSHEET.png") 'create + load the sprite sheet page

_DEST 0 'tell proggy to point to screen

DO
    FOR x = 0 TO 376 STEP 94

        _PUTIMAGE (64, 100)-(220, 200), WorkPage&, 0, (x, 0)-(x + 93, 95)
        _DELAY .15
        FrameNum& = FrameNum& + 1
        ' _DELAY .1
        LOCATE 22, 10: PRINT FrameNum&
        IF FrameNum& = 2 THEN GOTO 1 '// on this, I am just useing the 2 frames,because
        '// I did not want to have to change the sprite sheet. It can be change to 4 to
        '// run all 4.
        PRINT "HELLO WORLD,guess thats about it on this."
        PLAY "MB<a20g25>"
        PRINT "Hit any key to see the sprite sheet, then anykey to exit"

    NEXT x

    1:
    FrameNum& = 0
LOOP WHILE INKEY$ = ""


SLEEP 1
SCREEN WorkPage& 'show the sprite page
SLEEP
SYSTEM
Note, if you do not like the "beeps", remark out the PLAY, or turn your speaker off. This code is based on  "old lessons" and others in lessons.
from Garry
Here is the sprite sheet,again:
« Last Edit: September 07, 2011, 11:24:32 pm by GarrisonRicketson » Report Spam   Logged

Share on Facebook Share on Twitter

Dustie Bear
Full Member
***
Posts: 115


« Reply #1 on: March 11, 2011, 11:58:04 am »


That runs realy smooth for just using three sprites.

Im going to have to study how you get part out each sprit seperatly
and remembering which _dest hold the picture and where to put it. That
makes my head swim sometimes!  Cheesy

I will be studying this cause moving graphics is fun stuff!

Good job

Dustie


Report Spam   Logged
GarrisonRicketson
Admin
Administrator
Hero Member
*****
Posts: 583



WWW
« Reply #2 on: March 11, 2011, 02:47:37 pm »

I enjoy animations, alot, but then I realized, if they can be made interactive, as a game thats even better,...thanks on the reply,...
Report Spam   Logged

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



WWW
« Reply #3 on: September 05, 2011, 03:46:23 pm »

Well it has been so long now, I do not remember where I was with this.
Report Spam   Logged


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