Simple breakout in Hollywood

The place for any Hollywood tutorials

Simple breakout in Hollywood

Postby ArtBlink » Wed Nov 10, 2010 12:00 am

Hello,

I post this small code, good fun...
Code: Select all
@VERSION 4,0
@DISPLAY{WIDTH=320,HEIGHT=256}
CreateBrush(1,8,8,#GREEN)
CreateBrush(2,4,4,#RED)
CreateBrush(3,40,8,#BLUE)
CreateBrush(4,2,2,#WHITE)
CreateBrush(5,40,2,#WHITE)
CreateBrush(6,1,8,#WHITE)
CreateBrush(7,8,1,#WHITE)
MixBrush(1,6,128)
MixBrush(1,7,128)
MixBrush(2,4,128)
MixBrush(3,5,128)
Local XBarre=0
Local XBall=0
Local YBall=128
Local Vie=3
Local Score=0
Local XSens=1
Local YSens=-1
Local Renvoie=False
Local Casse=False
/*Attention, Tableau, le premier chiffre est la coordonnée X des briques*/
/*Le Deuxième Chiffre ET le Numéro de Brush, 1 étant la Brush Brique*/
LIGNE={}
LIGNE={0,1,8,1,16,1,24,1,32,1,40,1,48,1,56,1,64,1,72,1,80,1,88,1,96,1,104,1,112,1,
120,1,128,1,136,1,144,1,152,1,160,1,168,1,176,1,184,1,192,1,200,1,208,1,216,1,224,
1,232,1,240,1,248,1,256,1,264,1,272,1,280,1,288,1,296,1,304,1,312,1,320,1}
Function Ball()
XBall=XBall+XSens
YBall=Yball+YSens
If XBall=312 Then XSens=-1
If XBall=0 Then XSens=1
If YBall=10 Then YSens=1
Renvoie=Collision(#BRUSH,3,XBarre,248,2,XBall,YBall)
For x=1 To 81 Step 2
   If ligne[x]<>1 Then ligne[x-1]=-50
   Casse=Collision(#BRUSH,2,XBall,yball,1,Ligne[x-1],20)
   If Casse=True
      Ysens=1
      Ligne[x]=4
      Score=Score+10
   EndIf
Next
If Renvoie=True Then Ysens=-1
If YBall=256
   Ysens=-1
   Vie=Vie-1
EndIf
DisplayBrush(2,XBall,Yball)
EndFunction

Function Ecran()
For x=1 To 81 Step 2
   DisplayBrush(Ligne[x],Ligne[x-1],20)
Next
TextOut(0,0,"Score : ")
TextOut(80,0,Score)
TextOut(260,0,"Vie : ")
TextOut(310,0,Vie)
EndFunction

Respect
ArtBlink
 
Posts: 427
Joined: Mon Nov 01, 2010 11:37 am
Location: Albert - France

Re: Simple breakout in Hollywood

Postby mjnurney » Sun Aug 07, 2016 11:00 pm

Excellent
mjnurney
 
Posts: 8
Joined: Sun Nov 29, 2015 11:41 pm

Re: Simple breakout in Hollywood

Postby fjudde » Sat Sep 24, 2016 6:51 pm

ArtBlink wrote:Hello,

I post this small code, good fun...


Can't get it to run? Is all the code attached? seems something is missing?
:?:
_____________________________________
Hollywood 6.1
User avatar
fjudde
 
Posts: 20
Joined: Tue Dec 01, 2015 3:59 pm
Location: Stockholm, Sweden


Return to Tutorials

Who is online

Users browsing this forum: No registered users and 1 guest