Pages vues depuis 25/07/2007 : 25 184 637
Index du forum »» Création-Développement »» 3 mini moteur Hollywood pour un jeux...
@SCREEN?{Mode?=?"ask",?Width?=?320,?Height?=?256}
@SPRITE?1,"Fighter1.bmp",{width=52,height=52,frames=4,FPR=4,Transparency?=?#WHITE}
X=160
Y=100
XB=1
LeftMouseQuit(True)
EscapeQuit(True)
Function?Joueur()
????If?IsKeyDown("Left")=False?And?IsKeyDown("Right")=False?Then?xb=1
????If?IsKeyDown("Left")=True?Then?Gauche()
????If?IsKeyDown("Right")=True?Then?Droite()
????DisplaySprite(1,X,Y,XB)
EndFunction
Function?Gauche()
????X=X-10
????XB=0
????If?X<10?Then?X=10
EndFunction
Function?Droite()
????X=X+10
????XB=0
????If?X>640?Then?X=640
EndFunction
Function?PRG()
????Joueur()
EndFunction
SetInterval(1,PRG,1000/15)
Repeat
WaitEvent
Forever
@SCREEN?{Mode?=?"ask",?Width?=?320,?Height?=?256}
LoadBrush(1,?"Fighter1.bmp",?{Transparency?=?#WHITE})
X=160
Y=100
XB=52
SB=52
LeftMouseQuit(True)
EscapeQuit(True)
Function?Joueur()
????If?IsKeyDown("Left")=False?And?IsKeyDown("Right")=False?Then?xb=0
????If?IsKeyDown("Left")=True?Then?Gauche()
????If?IsKeyDown("Right")=True?Then?Droite()
????DisplayBrushPart(1,XB,0,X,Y,52,52)
EndFunction
Function?Gauche()
????If?XB=0?Then?SB=52
????X=X-10
????XB=XB+SB
????If?XB=156?Then?SB=-52
????If?XB=52?Then?SB=52
????If?X<10?Then?X=10
EndFunction
Function?Droite()
????If?XB=0?Then?SB=52
????X=X+10
????XB=XB+SB
????If?XB=156?Then?SB=-52
????If?XB=52?Then?SB=52
????If?X>640?Then?X=640
EndFunction
Function?PRG()
????Flip
????Cls
????Joueur()
EndFunction
SetInterval(1,PRG,1000/15)
BeginDoubleBuffer
Repeat
WaitEvent
Forever
JE?SECHE?LOL
@SCREEN {Mode = "ask", Width = 320, Height = 256}
LoadBrush(1, "Fighter1.bmp", {X=0,Y=0,Width=52,Height=52,Transparency = #WHITE})
LoadBrush(2, "Fighter1.bmp", {X=52,Y=0,Width=52,Height=52,Transparency = #WHITE})
LoadBrush(3, "Fighter1.bmp", {X=104,Y=0,Width=52,Height=52,Transparency = #WHITE})
LoadBrush(4, "Fighter1.bmp", {X=156,Y=0,Width=52,Height=52,Transparency = #WHITE})
X=160
Y=100
XB=1
SB=1
LeftMouseQuit(True)
EscapeQuit(True)
Function Joueur()
If IsKeyDown("Left")=False And IsKeyDown("Right")=False Then xb=1
If IsKeyDown("Left")=True Then Gauche()
If IsKeyDown("Right")=True Then Droite()
AddMove (1,#BRUSH,XB,X,Y)
DoMove(1)
ClearMove(1)
EndFunction
Function Gauche()
If XB=1 Then SB=1
X=X-10
XB=XB+SB
If XB=4 Then SB=-1
If XB=1 Then SB=1
If X<10 Then X=10
EndFunction
Function Droite()
If XB=1 Then SB=1
X=X+10
XB=XB+SB
If XB=4 Then SB=-1
If XB=1 Then SB=1
If X>640 Then X=640
EndFunction
Function PRG()
Cls ; Je veux enlever cette commande
Joueur()
EndFunction
EnableLayers
SetInterval(1,PRG,1000/20)
Repeat
WaitEvent
Forever