ludum-dare-22/objects/obj_bgmanager/Draw_0.gml

127 lines
4.8 KiB
Plaintext
Raw Normal View History

d3d_set_lighting(true)
mass += 1
if mass = 2048
mass = -2048
//bottom layers go on top
draw_set_alpha(1)
tex = background_get_texture(bg_floor)
d3d_draw_floor(-4096,-4096,-450,4096,4096,-450,tex,64,64)
tex = sprite_get_texture(spr_grave,0)
d3d_draw_block(room_width/2 - 60,room_height/2 - 60,-450,room_width/2 + 60,room_height/2 + 100,-420,tex,-1,-1)
d3d_draw_block(room_width/2 + 50,room_height/2 + 90,-420,room_width/2 - 50,room_height/2 + 70,-300,tex,1,-1)
tex = sprite_get_texture(spr_treetrunk,0)
d3d_draw_cylinder(500-5,1500-5,-450,500+5,1500+5,-150,tex,1,1,true,7)
tex = sprite_get_texture(spr_trees,0)
d3d_draw_cone(500-240,1500-240,-435,500+240,1500+240,-390,tex,1,1,true,7)
d3d_draw_cone(500-180,1500-180,-370,500+180,1500+180,-320,tex,1,1,true,7)
d3d_draw_cone(500-120,1500-120,-300,500+120,1500+120,-230,tex,1,1,true,7)
d3d_draw_cone(500-80,1500-80,-210,500+80,1500+80,-50,tex,1,1,true,7)
tex = sprite_get_texture(spr_treetrunk,0)
d3d_draw_cylinder(1500-5,1500-5,-450,1500+5,1500+5,-150,tex,1,1,true,7)
tex = sprite_get_texture(spr_trees,0)
d3d_draw_cone(1500-240,1500-240,-435,1500+240,1500+240,-390,tex,1,1,true,7)
d3d_draw_cone(1500-180,1500-180,-370,1500+180,1500+180,-320,tex,1,1,true,7)
d3d_draw_cone(1500-120,1500-120,-300,1500+120,1500+120,-230,tex,1,1,true,7)
d3d_draw_cone(1500-80,1500-80,-210,1500+80,1500+80,-50,tex,1,1,true,7)
tex = sprite_get_texture(spr_treetrunk,0)
d3d_draw_cylinder(1500-5,500-5,-450,1500+5,500+5,-150,tex,1,1,true,7)
tex = sprite_get_texture(spr_trees,0)
d3d_draw_cone(1500-240,500-240,-435,1500+240,500+240,-390,tex,1,1,true,7)
d3d_draw_cone(1500-180,500-180,-370,1500+180,500+180,-320,tex,1,1,true,7)
d3d_draw_cone(1500-120,500-120,-300,1500+120,500+120,-230,tex,1,1,true,7)
d3d_draw_cone(1500-80,500-80,-210,1500+80,500+80,-50,tex,1,1,true,7)
tex = sprite_get_texture(spr_treetrunk,0)
d3d_draw_cylinder(500-5,500-5,-450,500+5,500+5,-150,tex,1,1,true,7)
tex = sprite_get_texture(spr_trees,0)
d3d_draw_cone(500-240,500-240,-435,500+240,500+240,-390,tex,1,1,true,7)
d3d_draw_cone(500-180,500-180,-370,500+180,500+180,-320,tex,1,1,true,7)
d3d_draw_cone(500-120,500-120,-300,500+120,500+120,-230,tex,1,1,true,7)
d3d_draw_cone(500-80,500-80,-210,500+80,500+80,-50,tex,1,1,true,7)
tex = background_get_texture(bg_clouds2)
draw_set_alpha(.25)
d3d_draw_floor(mass+4096,-mass+4096,-200,mass-4096,-mass-4096,-200,tex,8,8)
tex = background_get_texture(bg_clouds1)
draw_set_alpha(.4)
d3d_draw_floor(-mass-4096,mass-4096,-150,-mass+4096,mass+4096,-150,tex,8,8)
tex = background_get_texture(bg_clouds1)
draw_set_alpha(.1)
d3d_draw_floor(-mass+600-4096,mass+600-4096,150,-mass-900+4096,mass-900+4096,150,tex,8,8)
tex = background_get_texture(bg_clouds2)
draw_set_alpha(.1)
d3d_draw_floor(-mass-600+4096,mass-600+4096,450,-mass+900-4096,mass+900-4096,450,tex,8,8)
draw_set_alpha(1)
if global.death > 0
{
//fade to black
with (obj_enemymanager)
{
instance_destroy()
}
with (obj_boss1)
{
instance_destroy()
}
sound_stop_all()
d3d_set_projection_ortho(0,0,1024,768,0)
d3d_set_lighting(false)
draw_set_alpha(global.death/20)
draw_rectangle_color(-1,-1,1025,769,c_black,c_black,c_black,c_black,false)
draw_set_color(c_white)
draw_set_font(fn_main)
draw_text(100,400,string_hash_to_newline("With all your power you could not repel the annoying neighbors."))
draw_text(100,430,string_hash_to_newline("You could not be left alone, and as a result could not rest in peace."))
draw_text(100,460,string_hash_to_newline("Welcome to an eternal cacophonic hell."))
draw_text(100,520,string_hash_to_newline("Bad ending."))
draw_set_font(fn_big)
draw_text(375,200,string_hash_to_newline("Game over"))
global.death += 1
if global.death = 250
{
room_goto(rm_menu)
}
}
if global.victory > 0
{
//fade to black
with (obj_enemymanager)
{
instance_destroy()
}
with (obj_boss1)
{
instance_destroy()
}
sound_stop_all()
d3d_set_projection_ortho(0,0,1024,768,0)
draw_set_alpha(global.victory/20)
d3d_set_lighting(false)
draw_rectangle_color(-1,-1,1025,769,c_white,c_white,c_white,c_white,false)
draw_set_color(c_black)
draw_set_font(fn_main)
draw_text(100,400,string_hash_to_newline("With your power, you repeled the worthless neighbors pernamently."))
draw_text(100,430,string_hash_to_newline("You, the ghost, can finally rest peacefully, a well earned reward."))
draw_text(100,460,string_hash_to_newline("It is alone and quiet, just as you prefer."))
draw_text(100,520,string_hash_to_newline("Good ending."))
draw_set_font(fn_big)
draw_text(375,200,string_hash_to_newline("Victory"))
global.victory += 1
if global.victory = 250
{
room_goto(rm_menu)
}
}