home *** CD-ROM | disk | FTP | other *** search
- Rem * Title : Flipping a Sprite
- Rem * Author : DBS-MB
- Rem * Date : 1st August 99
- rem ===================================================
- rem DARK BASIC EXAMPLE PROGRAM 8
- rem ===================================================
- rem This program will draw and flip a sprite on screen
- rem ---------------------------------------------------
-
- rem Set the ink to white and paper color to black
- ink rgb(244,214,210),1
-
- rem Load a bitmap on to the screen
- load bitmap "face.bmp"
-
- rem Grab image 1 from bitmap
- get image 1,18,17,156,196
-
- rem Clear the Screen
- cls
-
- rem Now we will make a sprite
- sprite 1,100,100,1
-
- rem get sprite width and find the middle of it going across
- rem get sprite height and find the middle of it going down
- rem new offset for sprite 1
-
- offset sprite 1,(sprite width(1)/2),(sprite height(1)/2)
-
- rem the is were on screen sprite will appear
- acrossscreen=(640/2)
- downscreen=(480/2)
-
- rem press left mouse button to quit
- rem move mouse left,right,up and down to stretch sprite
-
- print "the flip sprite command"
- repeat
-
- rem flip sprite
- flip sprite 1
-
- rem draw the sprite at the new position
- sprite 1,acrossscreen,downscreen,1
-
- until mouseclick()=1
-
- rem clear the screen
- cls
-
- rem remove the sprite from memory
- delete sprite 1
-
- rem remove image 1 from memory
- delete image 1
-
- rem End the program
- end
-