Type nicht mehr ansprechen [Problem gelöst]
Übersicht

CaeSarBetreff: Type nicht mehr ansprechen [Problem gelöst] |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
Hallo freunde der Sonne,
ich habe hier en Problem und zwar ich möchte die das die abgeschossen Quadrate nicht mehr angesprochen werden, hier is der Code. Code: [AUSKLAPPEN] Graphics 800,600,32,2 ;---------------------Grafiken TFormFilter 0 AutoMidHandle True Player = CreateImage(40,40) SetBuffer ImageBuffer(player) Color 255,0,0 Rect 0,0,40,40 x = 400 y = 300 laser = CreateImage(3,3) SetBuffer ImageBuffer(laser) Color 0,255,0 Rect 0,0,3,3 Dim player_anim(360) For winkel = 0 To 360 player_anim(winkel) = CopyImage(player) RotateImage player_anim(winkel),winkel Next ;--------------------Types Type shot Field shot_x Field shot_y End Type ;--------------------Game SetBuffer BackBuffer() Repeat ;Steuerung winkel = (ATan2 (y-MouseY(),x-MouseX())+270)Mod 360 If KeyDown(200) Then y = y - Cos(winkel)*3 x = x + Sin(winkel)*3 EndIf ; Mit Maus Schiessen If MouseDown(1) Then shot_counter = shot_counter +1 End If If shot_counter = 5 Then info.shot = New shot info\shot_x = x + Sin(winkel)*20 info\shot_y = y - Cos(winkel)*20 shot_counter = 0 End If For info.shot = Each shot info\shot_y = info\shot_y - Cos(winkel)*3 info\shot_x = info\shot_x + Sin(winkel)*3 DrawImage laser,info\shot_x,info\shot_y Next ;Player malen DrawImage player_anim(winkel),x,y Flip Cls Until KeyHit(1) End |
||
- Zuletzt bearbeitet von CaeSar am Di, Aug 26, 2008 14:14, insgesamt 2-mal bearbeitet
![]() |
ozzi789 |
![]() Antworten mit Zitat ![]() |
---|---|---|
https://www.blitzforum.de/help/Delete ![]() (hoffe ich hab nichts falsch verstanden) |
||
0x2B || ! 0x2B
C# | C++13 | Java 7 | PHP 5 |
CaeSar |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
Hi ozzi,
ich meine nicht den Type löschen, ich meine z.b. Ich schiesse ein Quadrat in einen bestimmten Winkel in eine bestimmte Richtung, jetzt schiesse ich ein zweites Quadrat in eine andere Richtung, das problem hierbei ist, dass das erste abgeschossene Quadrat in die Richtung des zweiten fliegt, ich will aber das das erste nicht mehr benutzt wird, solange es keinen Gegner trifft. mfg |
||
![]() |
Eingeproggt |
![]() Antworten mit Zitat ![]() |
---|---|---|
Du gibst einfach jedem Quadrat seinen eigenen winkel, mit dem du es bewegst?
Etwa so: Code: [AUSKLAPPEN] Type shot
Field shot_x Field shot_y Field shot_w End Type mfG und gutes Gelingen, Christoph. |
||
Gewinner des BCC 18, 33 und 65 sowie MiniBCC 9 |
CaeSar |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
Hi Eingeproggt, hat wunderbar funktioniert, ich danke dir.
Warum ich selber net drauf gekommen bin ![]() Falls es einer haben will: Code: [AUSKLAPPEN] Graphics 800,600,32,2 ;---------------------Grafiken TFormFilter 0 AutoMidHandle True Player = CreateImage(40,40) SetBuffer ImageBuffer(player) Color 255,0,0 Rect 0,0,40,40 x = 400 y = 300 laser = CreateImage(3,3) SetBuffer ImageBuffer(laser) Color 0,255,0 Rect 0,0,3,3 Dim player_anim(360) For winkel = 0 To 360 player_anim(winkel) = CopyImage(player) RotateImage player_anim(winkel),winkel Next ;--------------------Types Type shot Field shot_x Field shot_y Field shot_w End Type ;--------------------Game SetBuffer BackBuffer() Repeat ;Steuerung winkel = (ATan2 (y-MouseY(),x-MouseX())+270)Mod 360 If KeyDown(200) Then y = y - Cos(winkel)*3 x = x + Sin(winkel)*3 EndIf ; Mit Maus Schiessen If MouseDown(1) Then shot_counter = shot_counter +1 End If If shot_counter = 5 Then info.shot = New shot info\shot_x = x + Sin(winkel)*20 info\shot_y = y - Cos(winkel)*20 info\shot_w = (ATan2 (y-MouseY(),x-MouseX())+270)Mod 360 shot_counter = 0 End If For info.shot = Each shot info\shot_y = info\shot_y - Cos(info\shot_w)*3 info\shot_x = info\shot_x + Sin(info\shot_w)*3 DrawImage laser,info\shot_x,info\shot_y Next ;Player malen DrawImage player_anim(winkel),x,y Flip Cls Until KeyHit(1) End |
||
Übersicht


Powered by phpBB © 2001 - 2006, phpBB Group