picken... die x-te

Übersicht BlitzBasic Beginners-Corner

Gehe zu Seite Zurück  1, 2

Neue Antwort erstellen

 

Tapsi

BeitragSa, Jun 04, 2005 11:59
Antworten mit Zitat
Benutzer-Profile anzeigen
so, wie versprochen, hab ich jetzt dat problem mit der tür.

warum funktioniert das nicht so? wenn ich then und endif hinzufüge erhalte ich immer fehler.
BlitzBasic: [AUSKLAPPEN]

If HideEntity entity= True And KeyDown(18)
AddAnimSeq tur,200
Animate tur,3


oder muss ich das hideentity entity extra aufführen, wie z.B.

BlitzBasic: [AUSKLAPPEN]

x=HideEntity entity
If x = True Then...

Kryan

BeitragSa, Jun 04, 2005 12:03
Antworten mit Zitat
Benutzer-Profile anzeigen
schreib nochma den gesamten code...weil man ja nie weiß, was du jetzt verändert hast Wink
Webspaceanbieter?
Klick hier!
Kultige Spieleschmiede?
Klick hier!
 

Tapsi

BeitragSa, Jun 04, 2005 12:07
Antworten mit Zitat
Benutzer-Profile anzeigen
höhö, ned viel, ausser dass die funktionen jetzt nach der hauptschleife kommen. [
syntax="bb"]
Graphics3D 640,480
SetBuffer BackBuffer()

Const scenetype=1, camtype=2, tertype=3

Global camera=CreateCamera(), campitch
PositionEntity camera, 5, 4, 5
EntityType camera, 2
EntityRadius camera, 2

;---------------------------------------------------------------

boden=CreateTerrain(128)
gra_tex=LoadTexture("c:\programme\blitz3d demo\tex\boden\erde6.bmp")
EntityTexture boden, gra_tex
EntityType boden, 3

light=CreateLight( 1)
PositionEntity light, 66, 10, 66


;----------------------------------------------------------------



tur=CreateCube()
PositionEntity tur, 4, 4, 20
ScaleEntity tur, 2,4,0.1
turtex=LoadTexture ("C:\Programme\Blitz3D Demo\tex\verschiedenes\htur3.bmp")
EntityTexture tur,turtex
EntityType tur,3

SetAnimKey tur,100,1

RotateEntity tur,0,90,0
PositionEntity tur,2,4,20
SetAnimKey tur, 200, 1
;------------------------------------------------------------------





;-------------------------------------------------
Global pick=CreateCone()
PositionEntity pick, 10, 4, 10
EntityType pick, 3
EntityPickMode pick,2



;------------------------------------------------ <=== hier ist dat problem!!!
If HideEntity entity = True And KeyDown(18)
AddAnimSeq tur,200
Animate tur,3




;-------------------------------------------------------


wand1=CreateCube()
PositionEntity wand1, 1, 10, 64
ScaleEntity wand1, 1, 10, 64

wand2=CreateCube()
PositionEntity wand2, 127, 10, 64
ScaleEntity wand2, 1, 10, 64

wand3=CreateCube()
PositionEntity wand3, 64, 10, 1
ScaleEntity wand3, 64, 10, 1

wand4=CreateCube()
PositionEntity wand4, 64, 10, 127
ScaleEntity wand4, 64, 10, 1

wand_tex=LoadTexture("C:\Programme\Blitz3D Demo\tex\Steine\mauerwerk.bmp")
ScaleTexture wand_tex, 0.2, 0.7

EntityTexture wand1, wand_tex
EntityTexture wand2, wand_tex
EntityTexture wand3, wand_tex
EntityTexture wand4, wand_tex

EntityType wand1, 3
EntityType wand2, 3
EntityType wand3, 3
EntityType wand4, 3

;----------------------------------------------------------

;;hauptschleife;;

While Not KeyHit(1)

freelook()
picken()

If KeyDown(200) Then MoveEntity camera, 0, 0, 0.09
If KeyDown(208) Then MoveEntity camera, 0, 0, -0.09
If KeyDown(205) Then MoveEntity camera, 0.5, 0, 0
If KeyDown(203) Then MoveEntity camera, -0.5, 0, 0


If KeyDown(17) Then MoveEntity camera, 0, 0, 1
If KeyDown(31) Then MoveEntity camera, 0, 0, -1
If KeyDown(30) Then MoveEntity camera, 1, 0, 0
If KeyDown(32) Then MoveEntity camera, -1, 0, 0

If KeyDown(201) Then MoveEntity camera, 0, 0.1, 0
If KeyDown(209) Then MoveEntity camera, 0, -0.1, 0


Collisions 1, 2, 2, 1
Collisions 1, 3, 2, 1
Collisions 2, 3, 2, 1



UpdateWorld
RenderWorld



Flip
Wend
End

;-----------------------------------------------------------------



Function freelook()


HidePointer

mxspd#=MouseXSpeed()*0.25
; myspd#=MouseYSpeed()*0.25
campitch=campitch+myspd
If campitch<-85 Then campitch=-85
If campitch>85 Then campitch=85
RotateEntity camera,campitch,EntityYaw(camera)-mxspd,0


MoveMouse GraphicsWidth()/2,GraphicsHeight()/2


If KeyDown(203) Then mvx=mvx-.3
If KeyDown(205) Then mvx=mvx+.3
If KeyDown(200) Then mvz=mvz+.3
If KeyDown(208) Then mvz=mvz-.3

If KeyDown(30) Then mvx=mvx-.3
If KeyDown(32) Then mvx=mvx+.3
If KeyDown(17) Then mvz=mvz+.3
If KeyDown(31) Then mvz=mvz-.3

End Function

;------------------------------------------------------





Function picken()




mx=MouseX()
my=MouseY()
entity=CameraPick(camera,mx,my)


If entity<>0 And MouseDown(1) And EntityDistance (camera, pick)<3 Then
HideEntity entity

EndIf




End Function


[/syntax]

Kryan

BeitragSa, Jun 04, 2005 12:22
Antworten mit Zitat
Benutzer-Profile anzeigen
hideentity hat keinen rückgabewert
Webspaceanbieter?
Klick hier!
Kultige Spieleschmiede?
Klick hier!
 

Tapsi

BeitragSa, Jun 04, 2005 12:32
Antworten mit Zitat
Benutzer-Profile anzeigen
es klappt jetzt.

BlitzBasic: [AUSKLAPPEN]

Function picken()



mx=MouseX()
my=MouseY()
entity=CameraPick(camera,mx,my)


If entity<>0 And MouseDown(1) And EntityDistance (camera, pick)<3 Then
HideEntity entity
Merker = 1
EndIf


End Function

;------------------------------------------------

Function Tuer()

If Merker = 1 And KeyDown(18)
AddAnimSeq tur,200
Animate tur,3
End If
End Function



juchuuu Very Happy so, damit sind erstma alle fragen beantwortet Very Happy

Kryan

BeitragSa, Jun 04, 2005 12:40
Antworten mit Zitat
Benutzer-Profile anzeigen
gib nochma den code
wenn man die beiden funktionen einfach so einfügen würde ginge das nicht
da muss man erstmal paar sachen globalisieren ...
Webspaceanbieter?
Klick hier!
Kultige Spieleschmiede?
Klick hier!
 

Tapsi

BeitragSa, Jun 04, 2005 12:42
Antworten mit Zitat
Benutzer-Profile anzeigen
ja klar, die tür musste ich globalisieren, sonst geht das mit der funktion ja ned

BlitzBasic: [AUSKLAPPEN]

Graphics3D 640,480
SetBuffer BackBuffer()

Const scenetype=1, camtype=2, tertype=3
Global Merker
Global camera=CreateCamera(), campitch
PositionEntity camera, 5, 4, 5
EntityType camera, 2
EntityRadius camera, 2

;---------------------------------------------------------------

boden=CreateTerrain(128)
gra_tex=LoadTexture(\"c:\programme\blitz3d demo\tex\boden\erde6.bmp\")
EntityTexture boden, gra_tex
EntityType boden, 3

light=CreateLight( 1)
PositionEntity light, 66, 10, 66


;----------------------------------------------------------------



Global tur=CreateCube()
PositionEntity tur, 4, 4, 20
ScaleEntity tur, 2,4,0.1


turtex=LoadTexture (\"C:\Programme\Blitz3D Demo\tex\verschiedenes\htur3.bmp\")
EntityTexture tur,turtex
EntityType tur,3

SetAnimKey tur,100,1


RotateEntity tur,0,90,0
PositionEntity tur,2,4,20


SetAnimKey tur, 200, 1
;------------------------------------------------------------------



;-------------------------------------------------
Global pick=CreateCone()
PositionEntity pick, 10, 4, 10
EntityType pick, 3
EntityPickMode pick,2







;-------------------------------------------------------


wand1=CreateCube()
PositionEntity wand1, 1, 10, 64
ScaleEntity wand1, 1, 10, 64

wand2=CreateCube()
PositionEntity wand2, 127, 10, 64
ScaleEntity wand2, 1, 10, 64

wand3=CreateCube()
PositionEntity wand3, 64, 10, 1
ScaleEntity wand3, 64, 10, 1

wand4=CreateCube()
PositionEntity wand4, 64, 10, 127
ScaleEntity wand4, 64, 10, 1

wand_tex=LoadTexture(\"C:\Programme\Blitz3D Demo\tex\Steine\mauerwerk.bmp\")
ScaleTexture wand_tex, 0.2, 0.7

EntityTexture wand1, wand_tex
EntityTexture wand2, wand_tex
EntityTexture wand3, wand_tex
EntityTexture wand4, wand_tex

EntityType wand1, 3
EntityType wand2, 3
EntityType wand3, 3
EntityType wand4, 3

;----------------------------------------------------------

;;hauptschleife;;

While Not KeyHit(1)

freelook()
picken()
tuer()
If KeyDown(200) Then MoveEntity camera, 0, 0, 0.09
If KeyDown(208) Then MoveEntity camera, 0, 0, -0.09
If KeyDown(205) Then MoveEntity camera, 0.5, 0, 0
If KeyDown(203) Then MoveEntity camera, -0.5, 0, 0


If KeyDown(17) Then MoveEntity camera, 0, 0, 1
If KeyDown(31) Then MoveEntity camera, 0, 0, -1
If KeyDown(30) Then MoveEntity camera, 1, 0, 0
If KeyDown(32) Then MoveEntity camera, -1, 0, 0

If KeyDown(201) Then MoveEntity camera, 0, 0.1, 0
If KeyDown(209) Then MoveEntity camera, 0, -0.1, 0


Collisions 1, 2, 2, 1
Collisions 1, 3, 2, 1
Collisions 2, 3, 2, 1



UpdateWorld
RenderWorld



Flip
Wend
End

;-----------------------------------------------------------------



Function freelook()


HidePointer

mxspd#=MouseXSpeed()*0.25
; myspd#=MouseYSpeed()*0.25
campitch=campitch+myspd
If campitch<-85 Then campitch=-85
If campitch>85 Then campitch=85
RotateEntity camera,campitch,EntityYaw(camera)-mxspd,0


MoveMouse GraphicsWidth()/2,GraphicsHeight()/2


If KeyDown(203) Then mvx=mvx-.3
If KeyDown(205) Then mvx=mvx+.3
If KeyDown(200) Then mvz=mvz+.3
If KeyDown(208) Then mvz=mvz-.3

If KeyDown(30) Then mvx=mvx-.3
If KeyDown(32) Then mvx=mvx+.3
If KeyDown(17) Then mvz=mvz+.3
If KeyDown(31) Then mvz=mvz-.3

End Function

;------------------------------------------------------





Function picken()



mx=MouseX()
my=MouseY()
entity=CameraPick(camera,mx,my)


If entity<>0 And MouseDown(1) And EntityDistance (camera, pick)<3 Then
HideEntity entity
Merker = 1
EndIf


End Function

;------------------------------------------------

Function Tuer()

If Merker = 1 And KeyDown(18)
AddAnimSeq tur,200
Animate tur,1
End If
End Function



Kryan

BeitragSa, Jun 04, 2005 12:44
Antworten mit Zitat
Benutzer-Profile anzeigen
was muss man tun, damit die tür aufgeht?? Surprised
Webspaceanbieter?
Klick hier!
Kultige Spieleschmiede?
Klick hier!
 

Tapsi

BeitragSa, Jun 04, 2005 12:45
Antworten mit Zitat
Benutzer-Profile anzeigen
erst den kegel wegklicken und dann e drücken.
 

Tapsi

BeitragSa, Jun 04, 2005 12:47
Antworten mit Zitat
Benutzer-Profile anzeigen
gar ned schlecht, dafür dass ich das seit letzten sonntag mache und kaum kenntnisse in programmieren hab und auch noch weiblich bin Very Happy
 

FBI-blitz

BeitragSa, Jun 04, 2005 14:27
Antworten mit Zitat
Benutzer-Profile anzeigen
will ja nix heißen, dass du weiblich bist Smile
Computer 1: AMD Athlon64 3500+ | nVidia GF 7900GT | 1024 MB DDR-RAM | ASUS A8N-SLI Preimium | 250 GB SATA 2 || WindowsXP | Blitz3D | Blitz+
Computer 2: AMD AthlonXP 2400+ | ATI Radeon 9500 | 512 MB DDR-RAM | MSI K7N2 | 80 GB IDE | 160 GB IDE || WindowsXP | Blitz3D | Blitz+
Computer 3: Intel Pentium MMX | onBoard-Grafik | 32 MB RAM | 1 GB IDE || Windows 98 SE | Blitz+

Gehe zu Seite Zurück  1, 2

Neue Antwort erstellen


Übersicht BlitzBasic Beginners-Corner

Gehe zu:

Powered by phpBB © 2001 - 2006, phpBB Group