Collisionen
Übersicht

GeGenesisBetreff: Collisionen |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
Wieso kommt immer objekt exestirt nicht ...
Code: [AUSKLAPPEN] Function drawmove() For sh.sch = Each sch sh\x = sh\x +Rand(-1,1)+ Sin(sh\w)*sh\speed sh\y = sh\y +Rand(-1,1)- Cos(sh\w)*sh\speed For x1=0 To 19 For y1=0 To 19 If map(x1,y1)=1 col=ImagesCollide (s,sh\x,sh\y,0,box,x1*40,y1*40,0) If col=1 Then Delete sh EndIf Next Next Next End Function |
||
getlose |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
hast 's' und 'box' global gemacht ? wenn nicht musst du sie
als Parameter der Funktion übergeben. |
||
GeGenesis |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
Ja habe beide iamges global...
Code: [AUSKLAPPEN] Graphics 800,600,2
Type sch Field x Field y Field w Field speed End Type speed=2 w#=90 x#=400 y#=300 Global box=CreateImage(40,40) SetBuffer ImageBuffer(box) Color 200,200,200 Rect 0,0,40,40 Dim map(20,20) Data 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 Data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 Data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 Data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 Data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 Data 0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 Data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 Data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 Data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 Data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 Data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 Data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 Data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 Data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 Data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 Data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 Data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 Data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 Data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 Data 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 For y1=0 To 19 For x1=0 To 19 Read map(x1,y1) Next Next Global s=CreateImage(1,1) SetBuffer ImageBuffer(s) Color 255,255,0 Plot 0,0 SetBuffer BackBuffer() Dim Winkel(359) TFormFilter 0 For i = 0 To 359 Winkel(i) = LoadImage ("p.bmp") MidHandle Winkel(i) RotateImage Winkel(i), i MaskImage Winkel(i), 0, 0, 0 weit=weit+1 Color 100,100,100 Rect 400-(359/2)-2,298,359+4,4+20 Color 255,255,0 Rect 400-(359/2),300,weit,20 Flip Next amu=10 mag=2 Repeat Cls x2=x y2=y Text 10,10,"test winkel:"+l mx=MouseX() my=MouseY() draw() drawmove() drawmap() If amu=0 Then a=a+1 If a=20 Then If mag>0 Then mag=mag-1 amu=amu+6 a=0 EndIf EndIf EndIf If KeyDown(200) x# = x# + Sin(w#) y# = y# - Cos(w#) EndIf If KeyDown(203) Then w=w-3 If KeyDown(205) Then w=w+3 If KeyHit(29) Then If amu>0 sh.sch=New sch sh\x=x# sh\y=y# sh\w=w# sh\speed=10 amu=amu-1 EndIf EndIf If w=359 Or w>359 Then w=1 If w=0 Or w<0 Then w=358 DrawImage(Winkel(w#),x#,y#) Flip Until KeyHit(1) Function draw() For sh.sch = Each sch DrawImage s,sh\x,sh\y Next End Function Function drawmove() For sh.sch = Each sch sh\x = sh\x +Rand(-1,1)+ Sin(sh\w)*sh\speed sh\y = sh\y +Rand(-1,1)- Cos(sh\w)*sh\speed For x1=0 To 19 For y1=0 To 19 If map(x1,y1)=1 col=ImagesCollide (s,sh\x,sh\y,0,box,x1*40,y1*40,0) If col=1 Then Delete sh EndIf Next Next Next End Function Function drawmap() For y1=0 To 19 For x1=0 To 19 If map(x1,y1)=1 DrawImage(box,x1*40,y1*40) EndIf Next Next End Function |
||
AvaGast |
![]() Antworten mit Zitat |
|
---|---|---|
Du deletest "Sh" ... lässt die Schleifen aber weiterlaufen und es erneut prüfen.... | ||
GeGenesis |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
abr wie könte ich es verhindern ... | ||
![]() |
Hubsi |
![]() Antworten mit Zitat ![]() |
---|---|---|
Mit Null sollte es schon gehen, denke ich. Etwa so:Code: [AUSKLAPPEN] if sh.sch<>Null ... So oder so ähnlich ![]() |
||
Den ganzen Doag im Bett umanandflagga und iaz daherkema und meine Hendl`n fressn... |
GeGenesis |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
ok danke | ||
GeGenesis |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
Und iwe realisire ich am besten die collision vom player an den wänden ... | ||
![]() |
Seoman |
![]() Antworten mit Zitat ![]() |
---|---|---|
Es gibt auch Forensuche! | ||
In Australien...
Projekte sind zur Zeit wieder eingefroren und auf Designlevel zurueckgestuft... Generalueberholungen notwendig ![]() |
Übersicht


Powered by phpBB © 2001 - 2006, phpBB Group