Frage zur Bewegung
Übersicht

FlameskullBetreff: Frage zur Bewegung |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
Hi. ich hab ne frage zu meinm program.
Code: [AUSKLAPPEN] Graphics 800, 600, 32, 0 SetBuffer BackBuffer() ball = LoadImage("ball.bmp") MaskImage ball, 255, 255, 255 ballx = 10 bally = 300 dirballx = 0 Repeat If schuss=0 DrawImage ball, ballx, bally If KeyDown(17) Then bally=bally-2 If KeyDown(31) Then bally=bally+2 If KeyDown(30) Then ballx=ballx-2 If KeyDown(32) Then ballx=ballx+2 EndIf ballx = ballx+dirballx If MouseDown(1) Then schuss = 1 If schuss = 1 Then Repeat if schuss =1 then dirballx = 4 If dirballx < 10 Then dirballx = 1 If dirballx > 400 Then dirballx = -1 Forever Flip Cls Forever ich möchte, dass wenn ich auf die maus drücke, der ball sich zur seite bewegt. wie mache ich das? bzw was mache ich falsch? |
||
![]() |
PSY |
![]() Antworten mit Zitat ![]() |
---|---|---|
Code: [AUSKLAPPEN] If MouseDown(1) Then schuss = 1
If schuss = 1 Then Repeat if schuss =1 then dirballx = 4 If dirballx < 10 Then dirballx = 1 If dirballx > 400 Then dirballx = -1 Forever wenn die maus gedrückt wird, setzt du schuss auf 1. sobald schuss 1 ist, geht dein programm in eine endlosschleife (repeat .... forever) und kommt nicht mehr raus ^^ |
||
Flameskull |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
habs schon rausgefunden ![]() |
||
Übersicht


Powered by phpBB © 2001 - 2006, phpBB Group