Sprite löschen

Übersicht BlitzBasic Blitz3D

Neue Antwort erstellen

 

Mr. P

Betreff: Sprite löschen

BeitragSa, Feb 11, 2017 22:12
Antworten mit Zitat
Benutzer-Profile anzeigen
Hi, ich wollte fragen ob das löschen von sprites überhaupt möglich ist, weil bei mir geht das wirklich nicht auch mit freeentity.

So sieht der code bei mir aus, keine Ahnung wo das Problem is...

BlitzBasic: [AUSKLAPPEN]

; bullet
If MouseDown(1)
b.bullet = New bullet
b\bullet = CopyMesh(bullet,bullet)
b\sprite = CreateSprite()
HideEntity b\sprite
ScaleSprite b\sprite,10,10
b\frame = -1
b\p = -EntityPitch(b\bullet)
EntityTexture b\bullet,btex
EntityParent b\bullet,0
EndIf
For b.bullet = Each bullet
MoveEntity b\bullet,0,0,v0
If -EntityPitch(b\bullet) < b\p+90
TurnEntity b\bullet,1,0,0
EndIf
If EntityY(b\bullet) < 0
HideEntity b\bullet

b\frame = b\frame + 1

If b\frame = 0
PositionEntity b\sprite,EntityX(b\bullet),EntityY(b\bullet),EntityZ(b\bullet)
ShowEntity b\sprite
EndIf

EntityTexture b\sprite,expTex,b\frame
If frame = 7
FreeEntity b\sprite
FreeEntity b\bullet
Delete b
EndIf
EndIf
Next


*edit

Das war der Fehler, Danke man.
  • Zuletzt bearbeitet von Mr. P am Sa, Feb 11, 2017 23:06, insgesamt einmal bearbeitet

Xeres

Moderator

BeitragSa, Feb 11, 2017 22:27
Antworten mit Zitat
Benutzer-Profile anzeigen
~AUFSPALTUNG~


Bitte hole keine 13 Jahre alten Themen nach oben, danke.

Edit
In deinem Code steht "If frame = 7" und nicht "If b\frame = 7", dass könnte die Ursache sein.
Win10 Prof.(x64)/Ubuntu 16.04|CPU 4x3Ghz (Intel i5-4590S)|RAM 8 GB|GeForce GTX 960
Wie man Fragen richtig stellt || "Es geht nicht" || Video-Tutorial: Sinus & Cosinus
T
HERE IS NO FAIR. THERE IS NO JUSTICE. THERE IS JUST ME. (Death, Discworld)

Neue Antwort erstellen


Übersicht BlitzBasic Blitz3D

Gehe zu:

Powered by phpBB © 2001 - 2006, phpBB Group