Hey everyone. I need help with a code i am making. I am sort of new, i only know basic code, and i am trying to make a game, with a fake, usable computer desktop. I was trying out what was in my mind for the desktop. When the start menu button is clicked the start menu below the desktop itself, would change its order to above the desktop. So i did the coding, and tried it out, and it did not work. If someone could please help me with this code i would really appreciate it. thank you very much.
Graphics3D 640,480
SetBuffer BackBuffer()
type_bracket=1
type_arrow=2
light=CreateLight()
camera=CreateCamera()
PositionEntity camera,0,0,-1.5
;creating the background
background=CreateCube()
ScaleEntity background,1,1,.5
EntityColor background,100,100,250
EntityOrder background,0
EntityColor background,13,1,161
;start button
start=CreateCube()
ScaleEntity start,.3,.09,.000001
PositionEntity start,-1.2,-1.04,0
EntityOrder start,-1
tex=LoadTexture("start button.jpg")
EntityTexture start,tex
;bar
bar=CreateCube()
PositionEntity bar,.3,-1.04,0
ScaleEntity bar,1.2,.09,.000001
EntityOrder bar,-1
tex2=LoadTexture("bar.jpg")
EntityTexture bar,tex2
;creating the recycle bin
recycle=CreateCube()
PositionEntity recycle,1.3,-.8,0
ScaleEntity recycle,.1,.15,.000001
EntityOrder recycle,-1
tex3=LoadTexture("recycle2.jpg")
EntityTexture recycle,tex3
;creating the arrow
arrow=CreateCone()
ScaleEntity arrow,.06,.06,.000001
EntityOrder arrow,-3
RotateEntity arrow,0,0,40
stick=CreateCube()
ScaleEntity stick,.01,.07,.000001
RotateEntity stick,0,0,40
PositionEntity stick,.03,-.04,0
EntityOrder stick,-2
;the notebook
notebook=CreateCube()
ScaleEntity notebook,.15,.15,.000001
EntityOrder notebook,-1
PositionEntity notebook,-1.3,.8,0
tex4=LoadTexture("notebook.jpg")
EntityTexture notebook,tex4
;test square thangy
test=CreateCube()
ScaleEntity test,1,1,1
While Not KeyDown(1)
If KeyHit(57) Then
If EntityDistance(arrow,start)<2.0 Then
EntityOrder test,-5
EndIf
EndIf
;controlls
If KeyDown(200)=True Then MoveEntity arrow,.033,.04,0
If KeyDown(203)=True Then MoveEntity arrow,-.04,.033,0
If KeyDown(205)=True Then MoveEntity arrow,.04,-.033,0
If KeyDown(208)=True Then MoveEntity arrow,-.033,-.04,0
If KeyDown(200)=True Then MoveEntity stick,.033,.04,0
If KeyDown(203)=True Then MoveEntity stick,-.04,.033,0
If KeyDown(205)=True Then MoveEntity stick,.04,-.033,0
If KeyDown(208)=True Then MoveEntity stick,-.033,-.04,0
UpdateWorld
RenderWorld
Flip
Wend
End
|