Weekly Qbasic and Qb64 Lesson Topics
April 19, 2024, 02:35:28 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  

Weekly Lesson More Advanced, QB64 1st lesson

Pages: [1]
  Print  
Author Topic: Weekly Lesson More Advanced, QB64 1st lesson  (Read 1683 times)
GarrisonRicketson
Admin
Administrator
Hero Member
*****
Posts: 583



WWW
« on: February 04, 2011, 07:49:32 am »

GameLearn002
Code:
     REM GameLearn002
'Lets show the hawk graphics over the background
'Demonstaarte clearcolor
DEFLNG A-Z 'any variable with a name starting with the letters a throught to z are LONG types

CONST True = -1, False = NOT (True) 'constants for logic


Video& = _NEWIMAGE(640, 480, 32) 'screen 12 size 32bit colors
SCREEN Video& 'make this the surface the user sees on monitor
LOCATE 20, 1: PRINT "this line -->SCREEN Video&<-- created this output screen window"
_DELAY 1


Background& = _LOADIMAGE("Cliffinclouds.bmp") 'create the background page
Graphics& = _LOADIMAGE("Hawk_sprite.bmp") 'create the sprite sheet page


_LIMIT 30 '30 frames per second

PRINT "Press a key to see background"
Dummy$ = INPUT$(1)
_PUTIMAGE , Background&, Video& 'copy the background onto the video page
LOCATE 20, 1: PRINT "this line -->_PUTIMAGE , Background&, Video&<-- showed the bg on monitor"

_DELAY 1
PRINT "Press a key to see hawk graphics"
Dummy$ = INPUT$(1)
_PUTIMAGE (100, 100)-(275, 160), Graphics&, Video& 'copy the hawks over the background
LOCATE 20, 1: PRINT "this line ->_PUTIMAGE (100, 100)-(275, 160), Graphics&, Video&<- showed the hawks on monitor"

_DELAY 1
PRINT "Press a key to see hawk graphics with clearcolor"
Dummy$ = INPUT$(1)
_PUTIMAGE , Background&, Video& 'copy the background onto the video page
_CLEARCOLOR 0, Graphics& 'set clearcolor to black(background color on hawk sprite page)
_PUTIMAGE (100, 100)-(275, 160), Graphics&, Video& 'copy the hawks over the background

LOCATE 20, 1
PRINT "this line ->_PUTIMAGE , Background&, Video&<- showed the bg on monitor"
PRINT "This line ->_CLEARCOLOR 0, Graphics&<- declared the clearcolor is 0(zero) on Graphics page"
PRINT "this lines ->_PUTIMAGE (100, 100)-(275, 160), Graphics&, Video&<- showed the hawks on monitor"

_DELAY 1
PRINT "Press a key to EXIT"

SLEEP
SYSTEM

 
« Last Edit: September 07, 2011, 09:46:02 pm by GarrisonRicketson » 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