All pastes #44586 Raw Edit

Untitled

public text v1 · immutable
#44586 ·published 2006-03-05 20:13 UTC
rendered paste body
randomize 10
set display mode 800,600,32
sync on:sync rate 60

hide mouse

DIM BrickLeft(100)
DIM BrickTop(100)
DIM BrickRight(100)
DIM BrickBottom(100)
DIM BrickColor(100)

Bricktop = 150
Brickleft = 450
paddlex = 100
paddlyy = 275


load sound "musik.wav",1
load sound "godluckwarrior.wav",2
load image "brick.bmp",3
load image "paddle.bmp",4




REM Splash screen 1:
start$ = "Press S to start the game"
pong$ = "Breakout!"
creator$ = "Developed by Aaron Donaghey for CREAM course."
fade = 0
   Play sound 1
repeat
   set text size 80
   set text to bold
   ink rgb(255,255,255),0
   center text 400,200,pong$
   set text size 15
   set text size 15
   set text to normal
   if fade = 0 then fadedir = 1
   if fade = 255 then fadedir = 0
   if fadedir = 1 then fade = fade + 5
   if fadedir = 0 then fade = fade - 5
   ink rgb(fade,fade,fade),0
   center text 400,350,start$
   center text 400,500,creator$
   sync
   cls
until scancode() = 31

play sound 2
fade = 255
repeat
   ink rgb(fade,fade,fade),0
   set text size 80
   set text to bold
   center text 400,200,pong$
   set text size 15
   set text to normal
   center text 400,350,start$
   center text 400,500,creator$
   fade = fade - 5
   sync
   cls
until fade = 0

CLS
LOAD BITMAP "space.bmp", 5
Set current bitmap 0


   CLS
         SPAWNBRICKS()
         Sprite 101,100,275,4

   Sync

   DO

         Paddlex = paddlex - mousemovex()
         paddley = paddley - mousemovey()

         Copy bitmap 5, 0
         INK RGB(0,0,0),0
         BOX 0,0,800,100
         BOX 0,500,800,600
         INK RGB(255,255,255),0
         LINE 0,100,800,100
         LINE 0,500,800,500
         LINE 799,100,799,500
         Offset Sprite 101, (paddlex - mousemovex()), (paddley - mousemovey())
         Boundarycheckpaddle()
         SYNC
   LOOP


FUNCTION spawnbricks()
Bricktop = 150
Brickleft = 450
 For x = 1 to 100
   Sprite (x),Brickleft,bricktop,3
   Bricktop = bricktop + 30
   If bricktop > 449
    bricktop = 150
    brickleft = brickleft + 30
   Endif
   SYNC
 Next X
ENDFUNCTION

Function Boundarycheckpaddle()
`if paddlex=<0 then paddlex=0
`if paddlex=>200 then paddlex=200
`if paddley=<100 then paddley=100
`if paddley=>500 then paddley=500
If Sprite Y(101) =<100
Paddley = 200
endif
endfunction