Fixes/escape close build panel

main
Cameron Murphy Reikes 2 years ago
parent 0902089108
commit 90b11aef4e

@ -1593,8 +1593,15 @@ void create_station(GameState *gs, V2 pos, enum BoxType platonic_type)
void create_initial_world(GameState *gs) void create_initial_world(GameState *gs)
{ {
#if 0
Log("Creating debug world\n");
create_station(gs, (V2){-5.0f,0.0f}, BoxExplosive);
create_station(gs, (V2){0.0f, 5.0f}, BoxGyroscope);
#else
create_station(gs, (V2){-50.0f,0.0f}, BoxExplosive); create_station(gs, (V2){-50.0f,0.0f}, BoxExplosive);
create_station(gs, (V2){0.0f, 100.0f}, BoxGyroscope); create_station(gs, (V2){0.0f, 100.0f}, BoxGyroscope);
#endif
} }
void exit_seat(GameState *gs, Entity *seat_in, Entity *p) void exit_seat(GameState *gs, Entity *seat_in, Entity *p)

@ -671,6 +671,8 @@ static void ui(bool draw, float dt, float width, float height)
static bool picking_new_boxtype = false; static bool picking_new_boxtype = false;
static float pick_opacity = 0.0f; static float pick_opacity = 0.0f;
{ {
if(keypressed[SAPP_KEYCODE_ESCAPE].pressed)
picking_new_boxtype = false;
AABB pick_modal = (AABB){ AABB pick_modal = (AABB){
.x = width * 0.25f, .x = width * 0.25f,
.y = height * 0.25f, .y = height * 0.25f,
@ -1759,9 +1761,7 @@ static void frame(void)
sgp_set_image(0, image_solarpanel_charging); sgp_set_image(0, image_solarpanel_charging);
sgp_set_color(1.0f, 1.0f, 1.0f, b->sun_amount); sgp_set_color(1.0f, 1.0f, 1.0f, b->sun_amount);
pipeline_scope(goodpixel_pipeline) pipeline_scope(goodpixel_pipeline)
{
draw_texture_centered(entity_pos(b), BOX_SIZE); draw_texture_centered(entity_pos(b), BOX_SIZE);
}
sgp_reset_image(0); sgp_reset_image(0);
sgp_set_color(1.0f, 1.0f, 1.0f, 1.0f - b->sun_amount); sgp_set_color(1.0f, 1.0f, 1.0f, 1.0f - b->sun_amount);
/* Color to_set = colhexcode(0xeb9834); /* Color to_set = colhexcode(0xeb9834);
@ -1787,12 +1787,22 @@ static void frame(void)
if (b->box_type == BoxScanner) if (b->box_type == BoxScanner)
{ {
sgp_set_image(0, image_scanner_head); sgp_set_image(0, image_scanner_head);
transform_scope
{
sgp_rotate_at(b->scanner_head_rotate, entity_pos(b).x, entity_pos(b).y); sgp_rotate_at(b->scanner_head_rotate, entity_pos(b).x, entity_pos(b).y);
pipeline_scope(goodpixel_pipeline) pipeline_scope(goodpixel_pipeline)
draw_texture_centered(entity_pos(b), BOX_SIZE); draw_texture_centered(entity_pos(b), BOX_SIZE);
}
sgp_reset_image(0);
set_color(WHITE); set_color(WHITE);
} }
if(b->box_type == BoxScanner)
{
set_color(BLUE);
draw_circle(entity_pos(b), SCANNER_RADIUS);
set_color(WHITE);
}
sgp_set_color(0.5f, 0.1f, 0.1f, b->damage); sgp_set_color(0.5f, 0.1f, 0.1f, b->damage);
draw_color_rect_centered(entity_pos(b), BOX_SIZE); draw_color_rect_centered(entity_pos(b), BOX_SIZE);
} }

@ -12,7 +12,6 @@
#define PLAYER_JETPACK_TORQUE 0.05f #define PLAYER_JETPACK_TORQUE 0.05f
// #define PLAYER_JETPACK_FORCE 20.0f // #define PLAYER_JETPACK_FORCE 20.0f
// distance at which things become geostationary and no more solar power! // distance at which things become geostationary and no more solar power!
#define SUN_NO_MORE_ELECTRICITY_OR_GRAVITY 100.0f
#define PLAYER_JETPACK_ROTATION_ENERGY_PER_SECOND 0.2f #define PLAYER_JETPACK_ROTATION_ENERGY_PER_SECOND 0.2f
#define PLAYER_JETPACK_SPICE_PER_SECOND 0.2f #define PLAYER_JETPACK_SPICE_PER_SECOND 0.2f
#define SCANNER_ENERGY_USE 0.05f #define SCANNER_ENERGY_USE 0.05f
@ -31,12 +30,13 @@
#define MAX_SERVER_TO_CLIENT 1024 * 512 // maximum size of serialized gamestate buffer #define MAX_SERVER_TO_CLIENT 1024 * 512 // maximum size of serialized gamestate buffer
#define MAX_CLIENT_TO_SERVER 1024 * 10 // maximum size of serialized inputs and mic data #define MAX_CLIENT_TO_SERVER 1024 * 10 // maximum size of serialized inputs and mic data
#define SUN_RADIUS 10.0f #define SUN_RADIUS 10.0f
#define SUN_NO_MORE_ELECTRICITY_OR_GRAVITY 200.0f
#define INSTANT_DEATH_DISTANCE_FROM_SUN 2000.0f #define INSTANT_DEATH_DISTANCE_FROM_SUN 2000.0f
#define SUN_POS ((V2){50.0f, 0.0f}) #define SUN_POS ((V2){50.0f, 0.0f})
#ifdef NO_GRAVITY #ifdef NO_GRAVITY
#define SUN_GRAVITY_STRENGTH 0.0f #define SUN_GRAVITY_STRENGTH 0.0f
#else #else
#define SUN_GRAVITY_STRENGTH (9.0e2f) #define SUN_GRAVITY_STRENGTH (11.0e2f)
#endif #endif
#define SOLAR_ENERGY_PER_SECOND 0.09f #define SOLAR_ENERGY_PER_SECOND 0.09f
#define DAMAGE_TO_PLAYER_PER_BLOCK 0.1f #define DAMAGE_TO_PLAYER_PER_BLOCK 0.1f

Loading…
Cancel
Save