[Create]
alarm[7] = room_speed * 1
fire = 0
nearexit = false
alarm[1] = room_speed * 1
showmsg = false
jumpscare = false
fogmin = 0
fogdist = 256
damage_alpha = 0;
//Message Byte
msgbyte = "hello"
msgcolor = c_white
//Sway?
xax = 0
yax = 0
sprangle = 0
xmax = 20
ymax = 20
///Bob?
bob_up = true
bob_speed = 2.5
[Step]
///Reposition Weapon Sprite
if xax > 0
{
xax = 0
}
if yax > 0
{
yax = 0
}
if xax < -10
{
xax = -10
}
if yax < -10
{
yax = -10
}
if xax > 10
{
xax = 10
}
if yax > 10
{
yax = 10
}
if damage_alpha > 0
{
damage_alpha -= 0.04
}
[Draw]
if global.character = 2
{
d3d_transform_set_identity()
d3d_transform_set_rotation_z(obj_cam.direction - 90)
d3d_transform_add_translation(obj_cam.x,obj_cam.y,obj_cam.z - 8)
d3d_model_draw(axemdl,3.6,-17,0.7,background_get_texture(_axebody))
d3d_transform_set_identity()
}
if global.character = 4
{
d3d_transform_set_identity()
d3d_transform_set_rotation_z(obj_cam.direction - 90)
d3d_transform_add_translation(obj_cam.x,obj_cam.y,obj_cam.z - 8)
d3d_model_draw(vmodel2,5-xa-gun.xax/12,-17+ya-gun.yax/12,0.7,background_get_texture(bodgun))
d3d_transform_set_identity()
}
if global.character = 6
{
d3d_transform_set_identity()
d3d_transform_set_rotation_z(obj_cam.direction - 90)
d3d_transform_add_translation(obj_cam.x,obj_cam.y,obj_cam.z - 9)
d3d_model_draw(vmodel,3.6-xa-gun.xax/12,-17+ya-gun.yax/12,0.7,background_get_texture(_1911body))
d3d_transform_set_identity()
[Draw GUI]
d3d_set_projection_ortho(xax,yax,1280,800,sprangle); //I use this first to apply Weapon Sway / Bobbing to the 2D image. applies to Model since it uses the variables.
d3d_set_fog(0,0,0,0);
d3d_set_lighting(false)
d3d_set_hidden(false);
//Set Damage Effect First
draw_set_alpha(damage_alpha);
draw_sprite(hud_hurt,-1,0,0);
draw_set_alpha(1);
draw_sprite(global.wep_spr,fire,0,0); //Draw 2D weapon if Model is not present with Character.
d3d_set_projection_ortho(0,0,1280,800,0); //Set another projection for HUD. Disables bobbing and sway for HUD elements.
//Drawing HUD
draw_sprite(hud_test,global.character,0,0);
draw_set_blend_mode(bm_add)
draw_sprite(crosshair,global.cHair,640,400);
draw_set_blend_mode(bm_normal)
draw_set_font(font0);
draw_set_halign(fa_center)
draw_text(640,10,""+string(global.pscore)+"#X - "+string(xa)+"#Y - "+string(ya))
if global.multiplier > 1
{
draw_text(640,10,"###Multiplier X"+string(global.multiplier))
}
//draw level name
draw_set_color(c_white)
draw_set_font(font3)
draw_set_halign(fa_left)
draw_text(2,24,"Level: "+string(global.levelname));
//continue regular draw
draw_set_font(font0)
draw_set_halign(fa_left)
draw_text(90,740,""+string(global.player_hp)+"#"+string(global.difficulty))
draw_text(1150,760,""+string(global.keys))
draw_text(1150,720,""+string(global.potions))
//Drawing Scare HUD
if jumpscare
{
draw_sprite(hud_scare,-1,0,0);
}
//Drawing Finish HUD
if global.levelbeat
{
draw_sprite(hud_showinfo,-1,0,0);
draw_set_halign(fa_left)
draw_text(830,100,"LEVEL COMPLETE##Enemies Remaining: "+string(global.enemycount)+"#Secrets Found: "+string(global.secretsopen)+"/"+string(global.secrets)+"##Get ready!!")
}
draw_set_alpha(1);
//Notifications
draw_set_halign(fa_center)
if showmsg
{
draw_set_color(c_black);
draw_text(642,578,""+string(msgbyte))
draw_set_alpha(0.5);
draw_set_color(msgcolor);
draw_text(640,576,""+string(msgbyte))
draw_set_color(c_white);
draw_set_alpha(1);
}
draw_set_color(c_white);
d3d_set_hidden(true);
d3d_set_lighting(true)
d3d_set_fog(true,c_black,fogmin,fogdist);
[/B]
}