Forum » » Création-Développement » » 3 mini moteur Hollywood pour un jeux...
Posté : 26-11-2010 18:05
Hello,
@SCREEN?{Mode?=?"ask",?Width?=?320,?Height?=?256}
@SPRITE?1,"Fighter1.bmp",{width=52,height=52,frames=4,FPR=4,Transparency?=?#W HITE}
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
Cet article provient de Le site des utilisateurs francophones actuels et futurs d'AmigaOS 4.x
https://amiga-ng.org/viewtopic.php?topic=923&forum=14