ПроЭктировщик
Регистрация: 14.01.2012
Адрес: Зеленоград
Сообщений: 192
Написано 5 полезных сообщений (для 9 пользователей)
|
Ответ: Внедрение стартого меню
Спасибо, условие поставить получилось, но теперь Blitz не хочет загружать объекты, пишет Entity Does not exist, я сделал, вроде всё так...
Include "Constants.bb"
Include "Types.bb"
;--begin--;
Graphics3D 640,480,16,1
SetBuffer BackBuffer()
;--begin--;
;--objects--:
Global player
Global cam
Global shot1
Global shot2
Global shot_en1
Global enemy
Global enemy2
Global gun1
Global gun2
Global h_asp
Global pl_am
Global im_am
Global piv_fire
Global health_im
Global el_gun_ammo
Global pl_gun_ammo
Global gun_s1
;--objects--:
Global game%=0
Global update%=0
If game=0
cursor=LoadImage("textures\cursor.jpg")
MaskImage cursor,0,0,0
background=LoadTexture("menu.jpg")
back_box=CreateCube()
PositionEntity back_box,0,0,6
ScaleEntity back_box,7,5,0.1
EntityTexture back_box,background
cam2=CreateCamera()
light=CreateLight(cam2)
piv_ng=CreatePivot()
PositionEntity piv_ng,-2.75,0,4.77
ScaleEntity piv_ng,0.1,0.1,0.1
new_game=LoadMesh("models\menu\new game.3ds")
PositionEntity new_game,-3,0,5
ScaleEntity new_game,0.02,0.02,0.02
RotateEntity new_game,0,180,0
EntityPickMode new_game,2
NameEntity new_game,"ng"
EntityParent new_game,piv_ng
EndIf
If game=1
;--images--;
health_im=LoadImage("textures\health.bmp")
el_gun_ammo=LoadImage("textures\el_gun_ammo.bmp")
pl_gun_ammo=LoadImage("textures\pl_gun_ammo.bmp")
;--images--;
;--sounds--;
gun_s1=LoadSound("sounds\gun1.ogg")
;--sounds--;
;--sprites--;
shot1=LoadSprite("textures\shot1.bmp")
ScaleSprite shot1,3,3
EntityRadius shot1,1
EntityType shot1,TYPE_BULLET
HideEntity shot1
shot2=LoadSprite("textures\shot2.bmp")
ScaleSprite shot2,3,3
EntityRadius shot2,1
EntityType shot2,TYPE_BULLET
HideEntity shot2
shot_en1=LoadSprite("textures\shot3.bmp",2)
ScaleSprite shot_en1,5,5
EntityRadius shot_en1,5
EntityType shot_en1,TYPE_EN_BULLET
HideEntity shot_en1
;--sprites--;
;--main--;
pln=CreatePlane()
PositionEntity pln,0,-1,0
EntityType pln,TYPE_WALL
EntityColor pln,50,100,150
player=CreateSphere()
PositionEntity player,0,10,50
EntityRadius player,4
EntityType player, TYPE_PLAYER
EntityAlpha player,1
ScaleEntity player,1,1,1
TurnEntity player,0,180,0
cam=CreateCamera()
EntityParent cam,player
PositionEntity cam,0,5,0
enemy=LoadMesh("models\enemies\enemy1.3ds")
PositionEntity enemy,-5,10,-5
ScaleEntity enemy,0.5,0.5,0.5
MoveEntity enemy,-5,10,-5
EntityType enemy, TYPE_ENEMY
EntityRadius enemy, 4
enemy2=LoadMesh("models\enemies\enemy2.3ds")
PositionEntity enemy2,-5,10,-5
ScaleEntity enemy2,0.2,0.2,0.2
MoveEntity enemy2,-5,10,-5
box=CreateCube()
ScaleEntity box,20,20,2
TurnEntity box,0,90,0
PositionEntity box,70,0,80
EntityPickMode box,2
;--main--;
;--models--;
gun1=LoadMesh("models\level1\gun1.3ds")
ScaleEntity gun1,0.05,0.05,0.05
EntityParent gun1,cam
PositionEntity gun1,-1,-3,3
RotateEntity gun1,0,-90,0
HideEntity gun1
EntityOrder gun1,-1
gun2=LoadMesh("models\level1\gun2.3ds")
ScaleEntity gun2,0.05,0.05,0.05
EntityParent gun2,cam
PositionEntity gun2,-2,-7,0
RotateEntity gun2,0,-90,0
HideEntity gun2
EntityOrder gun2,-1
h_asp=LoadMesh("models\level1\health.3ds")
ScaleEntity h_asp,0.25,0.25,0.25
EntityType h_asp, TYPE_HEALTH
HideEntity h_asp
EntityFX h_asp,1
pl_am=LoadMesh("models\level1\pl_am.b3d")
ScaleEntity pl_am,0.1,0.1,0.1
EntityType pl_am, TYPE_PL_AMMO
EntityFX pl_am,1
HideEntity pl_am
im_am=LoadMesh("models\level1\im_am.b3d")
ScaleEntity im_am,0.1,0.1,0.1
EntityType im_am, TYPE_IMP_AMMO
PositionEntity im_am,5,1,5
EntityFX im_am,1
HideEntity im_am
;--models--;
;--pivots--;
piv_fire=CreatePivot()
EntityParent piv_fire,cam
PositionEntity piv_fire,-1.5,-1.5,8
;--pivots--;
;--collisions--;
Collisions TYPE_PLAYER, TYPE_WALL, 2, 3
Collisions TYPE_BULLET, TYPE_WALL, 2, 1
Collisions TYPE_BULLET, TYPE_ENEMY, 1, 1
Collisions TYPE_EN_BULLET, TYPE_PLAYER, 1, 1
;Collisions TYPE_EN_BULLET, TYPE_WALL, 2, 1
;--collisions--;
;--creations--;
CreateFirstAid()
CreateImpulseAmmo()
CreatePlasmaAmmo()
CreateEnemies(enemy)
;--creations--;
EndIf
;-------------------------------------------------------------
While Not KeyHit(1)
;-------------------------------------------------------------
If game=0
If EntityName(new_game)="ng"
If CameraPick(cam2,MouseX(),MouseY())
TurnEntity piv_ng,0,2,0
If MouseHit(1)
game=1
update=1
EndIf
Else
If EntityYaw(piv_ng)>0
TurnEntity piv_ng,0,-2,0
ElseIf EntityYaw(piv_ng)<0
TurnEntity piv_ng,0,2,0
EndIf
EndIf
EndIf
EndIf
If update=1
GameInput()
GameUpdate()
EndIf
UpdateWorld()
RenderWorld()
If update=1
GameDraw()
EndIf
DrawImage cursor,MouseX(),MouseY()
Flip
Wend
End
|