separated HUD object from 3D controller object, fixed HUD display errors

This commit is contained in:
magicalfeyfenny 2021-07-09 03:16:48 -04:00
parent ef03844e75
commit 3d83304a1f
13 changed files with 83 additions and 38 deletions

Binary file not shown.

View File

@ -15,7 +15,6 @@ global.scores = 0
global.boss = 0
d3d_start();
d3d_set_projection(x,y,z,0,0,0,0,0,1);
d3d_set_fog(true,c_ltgray,900-alarm[6]*7.4,1400-alarm[6]*7.4);
draw_set_color(c_white);

View File

@ -1,36 +1,4 @@
// HUD
d3d_set_projection_ortho(0,0,1024,768,0)
d3d_set_lighting(false)
draw_set_font(fn_main)
draw_text(800,700,string_hash_to_newline("FPS: / 30"))
draw_text(900,700,string_hash_to_newline(fps))
draw_set_font(fn_big)
draw_sprite(spr_life,0,10,10)
draw_text(120,10,string_hash_to_newline(global.life))
draw_sprite(spr_bombs,0,10,84)
draw_text(120,84,string_hash_to_newline(global.bombs))
draw_set_font(fn_main)
draw_text(600,10,string_hash_to_newline("Score:"))
draw_text(600,40,string_hash_to_newline("Hi-score:"))
draw_text(750,10,string_hash_to_newline(global.scores))
if global.scores > global.hiscore
draw_text(750,40,string_hash_to_newline(global.scores))
else
draw_text(750,40,string_hash_to_newline(global.hiscore))
if global.extend > 0
{
draw_text(500,200,string_hash_to_newline("Extend!"))
global.extend -= 1
}
if global.mesmult > 0
{
draw_text(475,230,string_hash_to_newline(global.mult))
draw_text(520,230,string_hash_to_newline("multiplier!"))
global.mesmult -= 1
}
lifecount = 0
d3d_set_lighting(true)
d3d_set_fog(true,c_ltgray,900-alarm[6]*7.4,1400-alarm[6]*7.4);
d3d_set_projection_perspective(0,0,1024,768,0)
d3d_set_projection(x,y,z,x,y+100,obj_player.z,0,0,1)

2
objects/obj_3Dmanager/Other_5.gml Executable file → Normal file
View File

@ -1,5 +1,5 @@
d3d_end()
d3d_set_lighting(false)
d3d_set_fog( false, c_white, 600, 3000 );
if global.scores > global.hiscore
global.hiscore = global.scores
global.victory = 0

View File

@ -0,0 +1,33 @@
// HUD
d3d_set_projection_ortho(0,0,1024,768,0)
d3d_set_lighting(false)
d3d_set_fog( false, c_white, 600, 3000 );
draw_set_font(fn_main)
draw_text(800,700,string_hash_to_newline("FPS: / 30"))
draw_text(900,700,string_hash_to_newline(fps))
draw_set_font(fn_big)
draw_sprite(spr_life,0,10,10)
draw_text(120,10,string_hash_to_newline(global.life))
draw_sprite(spr_bombs,0,10,84)
draw_text(120,84,string_hash_to_newline(global.bombs))
draw_set_font(fn_main)
draw_text(600,10,string_hash_to_newline("Score:"))
draw_text(600,40,string_hash_to_newline("Hi-score:"))
draw_text(750,10,string_hash_to_newline(global.scores))
if global.scores > global.hiscore
draw_text(750,40,string_hash_to_newline(global.scores))
else
draw_text(750,40,string_hash_to_newline(global.hiscore))
if global.extend > 0
{
draw_text(500,200,string_hash_to_newline("Extend!"))
global.extend -= 1
}
if global.mesmult > 0
{
draw_text(475,230,string_hash_to_newline(global.mult))
draw_text(520,230,string_hash_to_newline("multiplier!"))
global.mesmult -= 1
}
lifecount = 0
d3d_set_lighting(true)

View File

@ -0,0 +1,33 @@
{
"spriteId": null,
"solid": false,
"visible": true,
"spriteMaskId": null,
"persistent": false,
"parentObjectId": null,
"physicsObject": false,
"physicsSensor": false,
"physicsShape": 1,
"physicsGroup": 1,
"physicsDensity": 0.5,
"physicsRestitution": 0.1,
"physicsLinearDamping": 0.1,
"physicsAngularDamping": 0.1,
"physicsFriction": 0.2,
"physicsStartAwake": true,
"physicsKinematic": false,
"physicsShapePoints": [],
"eventList": [
{"isDnD":false,"eventNum":0,"eventType":8,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",},
],
"properties": [],
"overriddenProperties": [],
"parent": {
"name": "Objects",
"path": "folders/Objects.yy",
},
"resourceVersion": "1.0",
"name": "obj_HUD",
"tags": [],
"resourceType": "GMObject",
}

View File

@ -1 +1,3 @@
fadein = 0;
d3d_set_projection_ortho( 0, 0, 640, 480, 0 );

View File

@ -1,3 +1,6 @@
wait = 0;
fadein = 0;
menuchoice = 0;
d3d_start();
d3d_set_projection_ortho( 0, 0, 640, 480, 0 );

View File

@ -0,0 +1 @@
d3d_set_projection_ortho( 0, 0, 640, 480, 0 );

1
objects/obj_plot/obj_plot.yy Executable file → Normal file
View File

@ -20,6 +20,7 @@
"eventList": [
{"isDnD":false,"eventNum":27,"eventType":9,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",},
{"isDnD":false,"eventNum":13,"eventType":9,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",},
{"isDnD":false,"eventNum":0,"eventType":0,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",},
],
"properties": [],
"overriddenProperties": [],

View File

@ -1,3 +1,5 @@
wait = 0;
fadein = 0;
menuchoice = 0;
d3d_set_projection_ortho( 0, 0, 640, 480, 0 );

View File

@ -15,6 +15,7 @@
"layers": [
{"instances":[
{"properties":[],"isDnd":false,"objectId":{"name":"obj_bgmanager","path":"objects/obj_bgmanager/obj_bgmanager.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":32.0,"y":0.0,"resourceVersion":"1.0","name":"inst_F2CDA2AB","tags":[],"resourceType":"GMRInstance",},
{"properties":[],"isDnd":false,"objectId":{"name":"obj_HUD","path":"objects/obj_HUD/obj_HUD.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":0.0,"y":32.0,"resourceVersion":"1.0","name":"inst_7091829D","tags":[],"resourceType":"GMRInstance",},
],"visible":true,"depth":-100,"userdefinedDepth":true,"inheritLayerDepth":false,"inheritLayerSettings":false,"gridX":32,"gridY":32,"layers":[],"hierarchyFrozen":false,"resourceVersion":"1.0","name":"Compatibility_Instances_Depth_-100","tags":[],"resourceType":"GMRInstanceLayer",},
{"instances":[
{"properties":[],"isDnd":false,"objectId":{"name":"obj_fire","path":"objects/obj_fire/obj_fire.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":0.0,"y":0.0,"resourceVersion":"1.0","name":"inst_326E69AD","tags":[],"resourceType":"GMRInstance",},
@ -41,6 +42,7 @@
{"name":"inst_CBC73857","path":"rooms/rm_game/rm_game.yy",},
{"name":"inst_326E69AD","path":"rooms/rm_game/rm_game.yy",},
{"name":"inst_F2CDA2AB","path":"rooms/rm_game/rm_game.yy",},
{"name":"inst_7091829D","path":"rooms/rm_game/rm_game.yy",},
],
"inheritCreationOrder": false,
"sequenceId": null,

View File

@ -59,6 +59,7 @@
{"id":{"name":"d3d_start","path":"scripts/d3d_start/d3d_start.yy",},"order":35,},
{"id":{"name":"d3d_transform_add_rotation_x","path":"scripts/d3d_transform_add_rotation_x/d3d_transform_add_rotation_x.yy",},"order":37,},
{"id":{"name":"d3d_transform_add_rotation_y","path":"scripts/d3d_transform_add_rotation_y/d3d_transform_add_rotation_y.yy",},"order":39,},
{"id":{"name":"obj_HUD","path":"objects/obj_HUD/obj_HUD.yy",},"order":50,},
{"id":{"name":"d3d_transform_add_rotation_z","path":"scripts/d3d_transform_add_rotation_z/d3d_transform_add_rotation_z.yy",},"order":41,},
{"id":{"name":"d3d_transform_add_translation","path":"scripts/d3d_transform_add_translation/d3d_transform_add_translation.yy",},"order":43,},
{"id":{"name":"d3d_transform_set_identity","path":"scripts/d3d_transform_set_identity/d3d_transform_set_identity.yy",},"order":45,},