Illegal Memory Adress bei ImagesCollide ?!?
Übersicht

![]() |
ozzi789Betreff: Illegal Memory Adress bei ImagesCollide ?!? |
![]() Antworten mit Zitat ![]() |
---|---|---|
Hi
Ich hab aus einem Tut eine Kollision eingefügt Es funktioniert auch, wenn ich jedoch in die "mitte" fahre gibts ned IMA ![]() Der Code Code: [AUSKLAPPEN] Graphics 800,600,16,2
Global game=0 SetBuffer BackBuffer() Global menu_timer = CreateTimer(60) FlushKeys counter=3 While Not game=1 WaitTimer (menu_timer) Cls kh=KeyHit(28) Color 230,40,40 Text 360,240, "Spielen" Text 360,280, "Hilfe" Text 360,320, "Beenden" If KeyHit("200") And counter < 3 Then counter = counter+1 If KeyHit("208") And counter > 1 Then counter = counter-1 If counter = 3 And kh Then startgame If counter = 2 And kh Then help If counter = 1 And kh Then End If counter = 3 Then Color 20,30,255 Text 360,240, "Spielen" :Text 340,240, ">" If counter = 2 Then Color 20,30,255 Text 360,280, "Hilfe" :Text 340,280, ">" If counter = 1 Then Color 20,30,255 Text 360,320, "Beenden" :Text 340,320, ">" Flip Wend Function startgame () FlushKeys Cls game=1 End Function Function help () FlushKeys Cls Print "Help File ^^" WaitKey End End Function .start Cls Print "loading..." Delay (200) Button = LoadImage ("c:\back.bmp") MaskImage Button , 0,0,0 Const ESC = 1,Hoch= 200,Runter=208,Links = 203,Rechts=205 , Space = 57 Const Gas#= 0.06, Traegheit#=0.02, Speedmax=3 Const Lenkspeed = 1 Const Grafk_rotate = 5; hier nur durch 360 teilbares ; 1,2,3,4,5,6,8,9,10,12,15,18,usw. Const debugmode =1 Anzahlblder_Auto = 360/Grafk_rotate Dim Auto (Anzahlblder_Auto );AutoGrafik_berechnen max 360 Einzelbilder < Auto(0) = CreateImage (40,20) ; also nur die erstellen die wirklich gebraucht werden! Color 128,128,128:Rect 0,0,40,20,1 : Color 255,255,128:Oval 33,3,5,5 :Oval 33,12,5,5 GrabImage Auto(0),0,0 For z = 0 To Anzahlblder_Auto Cls Auto(z) = CopyImage (Auto(0)) RotateImage Auto(z),z* Grafk_rotate HandleImage Auto(0),10,10 Next;AutoGrafik_berechnen max 360 Einzelbilder ......fertig ;startposition positionX# = 400 : positionY# = 300 Print "Finished Loading, Press Any Key to continue" WaitKey SetBuffer BackBuffer() While Not KeyDown(ESC);####################################### ; tasten abfrage Grad#=((Grad+(KeyDown(Rechts)-KeyDown(Links))*Lenkspeed* speed#)+360)Mod 360 Speed# = Speed# +(KeyDown( Hoch) - KeyDown(Runter))*Gas# If Speed# >0.1 If ImagesCollide (Auto(Autograd ),positionX#,positionY#,0,Button,x,y,0) Then Speed# = Speed# - 5 EndIf If (KeyDown(Hoch)+KeyDown(Runter)) = 0 Then If Speed# > 0 Then Speed# = Speed# - Traegheit# ;langsam werden If Speed# < 0 Then Speed# = Speed# + Traegheit# ;langsam werden If Speed# < Traegheit# And Speed# > (Traegheit#*-1) Then Speed# = 0; völliger Stillstand End If If speed# > Speedmax Then speed# = Speedmax If speed# < (Speedmax*-1) Then speed# = (Speedmax*-1) ;Position ändern Auto positionX# = positionX# + Cos(Grad) * speed# positionY# = positionY# + Sin(Grad) * speed# PositionY# = (PositionY#+GraphicsHeight ()) Mod GraphicsHeight() PositionX# = (PositionX#+GraphicsWidth ()) Mod GraphicsWidth () ; berechnung welches Bild angezeigt wird ; Beispiel Grafk_rotate = 5 bedeutet das nur 1 Bild für 5 Gradstufen angezeigt wird Autograd = (grad+Grafk_rotate/2)/Grafk_rotate DrawImage Auto(Autograd ),Int(positionX#),Int(positionY#) DrawImage Button , x,y ;#################################################### Gosub Debug ; speedbremse While MilliSecs()< fx : Wend : fx = MilliSecs()+16 ; Flip : Cls: bwx= bwx +1:If MilliSecs() > oltZeit + 999 BW = bwx:bwx = 0: oltZeit= MilliSecs() ;FPS Wend :End;################################################# .Debug Text 10,10 ,"FPS: " + BW: Text 10,30 ,"Speed: " + Speed# Text 10,50 ,"Lenkspeed: " + Lenkspeed Text 10,70 ,"Grad: " + Grad Text 10,90 ,"Grad des Bildes:" +Autograd*Grafk_rotate Return Weiss jemand wieso ? MFG Ozzi789 |
||
0x2B || ! 0x2B
C# | C++13 | Java 7 | PHP 5 |
![]() |
RallimenSieger des 30-EUR-Wettbewerbs |
![]() Antworten mit Zitat ![]() |
---|---|---|
Ja weil dein Button oben links gezeichnet wird und nicht in der Mitte! | ||
[BB2D | BB3D | BB+]
|
Dreamora |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
darüber hinaus hast du ne nvidia. wenn du extra neue treiber installiert hast, hast du dir damit den todesstoss gegeben fürchte ich | ||
Ihr findet die aktuellen Projekte unter Gayasoft und könnt mich unter @gayasoft auf Twitter erreichen. |
![]() |
ozzi789 |
![]() Antworten mit Zitat ![]() |
---|---|---|
@Dremora
Wie soll ich das verstehen ![]() @Rallimen Das Probier ich gerade mal aus ^^ Das Bild is 800,600 gross, darum muss es ja links oben gezeichnet werden, oder ? Es is wie eine "Rennstrecke" |
||
0x2B || ! 0x2B
C# | C++13 | Java 7 | PHP 5 |
Dreamora |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
Das sollst du so verstehen dass es bekannt ist das neue NVIDIA treiber zu blöd sind DX7 korrekt zu unterstützen.
Konsequenz ist das ImageCollide durchaus einfach nicht geht und direkt zu Memory Access Violation tendieren wenn mans dennoch probiert und so. vor allem 150er treiber und höher kann man böse gesagt vergessen für DX7 IMA hingegen könnte auch darauf hindeuten dass du nicht die aktuelle Blitz3D oder BlitzPlus version hast (B3D 1.87 oder höher, B+ weiss ich net welche DEP rein brachte) |
||
Ihr findet die aktuellen Projekte unter Gayasoft und könnt mich unter @gayasoft auf Twitter erreichen. |
![]() |
ozzi789 |
![]() Antworten mit Zitat ![]() |
---|---|---|
Ich hab ne ur alte Version von BB3D xD
Ich lad mia grad ma die neue drauf. |
||
0x2B || ! 0x2B
C# | C++13 | Java 7 | PHP 5 |
Dreamora |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
die aktuellste Demo ist 1.90 und kann direkt auf blitzbasic.com bezogen werden.
neueste vollversion ist 1.99, wobei einige vermutlich bei der 1.98 geblieben sind wie ich auch |
||
Ihr findet die aktuellen Projekte unter Gayasoft und könnt mich unter @gayasoft auf Twitter erreichen. |
![]() |
ozzi789 |
![]() Antworten mit Zitat ![]() |
---|---|---|
Ich hab mia gad die 1.99 installiert.
Jetz stürtz BB ned mehr ganz ab bei der IMA (ja vorher is der ganze Ide abgekratzt xD) Doch das Problem besteht immer noch ![]() Jedoch nur in der Mitte (ein Rect von etwa 30,30) Is das die Graka? ![]() |
||
0x2B || ! 0x2B
C# | C++13 | Java 7 | PHP 5 |
![]() |
ozzi789 |
![]() Antworten mit Zitat ![]() |
---|---|---|
Denke das ist ein Doppelpost wert !
Die Fehlermeldung kommt nur dann wen der "Winkel" des Autos 24-25 beträgt ?!? Was soll ich tun ? |
||
0x2B || ! 0x2B
C# | C++13 | Java 7 | PHP 5 |
Übersicht


Powered by phpBB © 2001 - 2006, phpBB Group