SELECT CASE month% CASE 12, 1, 2 season$ = "Winter" CASE 3 TO 5 season$ = "Spring" CASE ELSE season$ = "Other" END SELECT FOR...NEXT
' DO WHILE / DO UNTIL x = 1 DO WHILE x <= 5 PRINT x x = x + 1 LOOP ' Infinite loop with EXIT DO DO INPUT "Enter password: ", p$ IF p$ = "secret" THEN EXIT DO LOOP
sprite& = _NEWIMAGE(32, 32, 32) _DEST sprite& ' draw onto sprite CLS , _RGB(255,0,0) ' red background _DEST 0 ' back to main screen _PUTIMAGE (mouseX, mouseY), sprite& SCREEN _NEWIMAGE(800, 600, 32) _DISPLAY ' start rendering DO _LIMIT 60 ' 60 FPS CLS ' draw frame... x = x + 1 _PUTIMAGE (x, 300), player& _DISPLAY ' show frame LOOP Chapter 8: Audio & Sound 8.1 Legacy Sound (PC Speaker) SOUND 440, 18 ' 440Hz for 1 second (18 ticks = 1 sec) BEEP ' simple beep PLAY "MB L8 O3 C D E F G" ' music macro language 8.2 Modern Sound (_SND Commands) Load and play:
_DISPLAY LOOP UNTIL _KEYDOWN(27) ' ESC to quit SYSTEM
INPUT "Age: ", age LINE INPUT "Full name: ", fullname$ ' allows commas/spaces INPUT$ (1) ' read one key without Enter 5.1 Conditional Statements IF...THEN...ELSE
SELECT CASE month% CASE 12, 1, 2 season$ = "Winter" CASE 3 TO 5 season$ = "Spring" CASE ELSE season$ = "Other" END SELECT FOR...NEXT
' DO WHILE / DO UNTIL x = 1 DO WHILE x <= 5 PRINT x x = x + 1 LOOP ' Infinite loop with EXIT DO DO INPUT "Enter password: ", p$ IF p$ = "secret" THEN EXIT DO LOOP qb64 manual pdf
sprite& = _NEWIMAGE(32, 32, 32) _DEST sprite& ' draw onto sprite CLS , _RGB(255,0,0) ' red background _DEST 0 ' back to main screen _PUTIMAGE (mouseX, mouseY), sprite& SCREEN _NEWIMAGE(800, 600, 32) _DISPLAY ' start rendering DO _LIMIT 60 ' 60 FPS CLS ' draw frame... x = x + 1 _PUTIMAGE (x, 300), player& _DISPLAY ' show frame LOOP Chapter 8: Audio & Sound 8.1 Legacy Sound (PC Speaker) SOUND 440, 18 ' 440Hz for 1 second (18 ticks = 1 sec) BEEP ' simple beep PLAY "MB L8 O3 C D E F G" ' music macro language 8.2 Modern Sound (_SND Commands) Load and play: SELECT CASE month% CASE 12, 1, 2 season$
_DISPLAY LOOP UNTIL _KEYDOWN(27) ' ESC to quit SYSTEM SELECT CASE month% CASE 12
INPUT "Age: ", age LINE INPUT "Full name: ", fullname$ ' allows commas/spaces INPUT$ (1) ' read one key without Enter 5.1 Conditional Statements IF...THEN...ELSE
|
|
|
This has been the page of
bikini dare and isabel