Remove gold and add tab tutorial image

main
Cameron Murphy Reikes 2 years ago
parent abcc5b9475
commit f78b20c688

@ -1490,8 +1490,6 @@ SerMaybeFailure ser_server_to_client(SerState *ser, ServerToClient *s)
SER_VAR(&gs->tick); SER_VAR(&gs->tick);
SER_VAR(&gs->subframe_time); SER_VAR(&gs->subframe_time);
SER_MAYBE_RETURN(ser_V2(ser, &gs->goldpos));
if (!ser->save_or_load_from_disk) // don't save player info to disk, this is filled on connection/disconnection if (!ser->save_or_load_from_disk) // don't save player info to disk, this is filled on connection/disconnection
{ {
for (size_t i = 0; i < MAX_PLAYERS; i++) for (size_t i = 0; i < MAX_PLAYERS; i++)
@ -2374,13 +2372,6 @@ void process(struct GameState *gs, double dt)
#ifdef INFINITE_RESOURCES #ifdef INFINITE_RESOURCES
p->damage = 0.0; p->damage = 0.0;
#endif #endif
// update gold win condition
if (cpvlength(cpvsub((cpBodyGetPosition(p->body)), gs->goldpos)) < GOLD_COLLECT_RADIUS)
{
p->goldness += 0.1;
p->damage = 0.0;
gs->goldpos = (cpVect){.x = hash11((float)elapsed_time(gs)) * 20.0, .y = hash11((float)elapsed_time(gs) - 13.6) * 20.0};
}
#if 1 #if 1
cpVect world_hand_pos = get_world_hand_pos(gs, &player->input, p); cpVect world_hand_pos = get_world_hand_pos(gs, &player->input, p);
if (player->input.seat_action) if (player->input.seat_action)

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 B

@ -49,6 +49,7 @@ static bool keydown[MAX_KEYDOWN] = {0};
static bool piloting_rotation_capable_ship = false; static bool piloting_rotation_capable_ship = false;
static double rotation_learned = 0.0; static double rotation_learned = 0.0;
static double rotation_in_cockpit_learned = 0.0; static double rotation_in_cockpit_learned = 0.0;
static double zoomeasy_learned = 0.0;
typedef struct KeyPressed typedef struct KeyPressed
{ {
bool pressed; bool pressed;
@ -121,6 +122,7 @@ static sg_image image_missile;
static sg_image image_missile_burning; static sg_image image_missile_burning;
static sg_image image_rightclick; static sg_image image_rightclick;
static sg_image image_rothelp; static sg_image image_rothelp;
static sg_image image_zoomeasyhelp;
static sg_image image_gyrospin; static sg_image image_gyrospin;
static enum BoxType toolbar[TOOLBAR_SLOTS] = { static enum BoxType toolbar[TOOLBAR_SLOTS] = {
@ -648,6 +650,7 @@ static void init(void)
image_rightclick = load_image("loaded/right_click.png"); image_rightclick = load_image("loaded/right_click.png");
image_rothelp = load_image("loaded/rothelp.png"); image_rothelp = load_image("loaded/rothelp.png");
image_gyrospin = load_image("loaded/gyroscope_spinner.png"); image_gyrospin = load_image("loaded/gyroscope_spinner.png");
image_zoomeasyhelp = load_image("loaded/zoomeasyhelp.png");
} }
// socket initialization // socket initialization
@ -805,8 +808,10 @@ static void ui(bool draw, double dt, double width, double height)
if (draw) if (draw)
sgp_push_transform(); sgp_push_transform();
// rotation helper // helpers
if (draw) if (draw)
{
// rotation
{ {
double alpha = 1.0 - clamp01(rotation_learned); double alpha = 1.0 - clamp01(rotation_learned);
if (piloting_rotation_capable_ship) if (piloting_rotation_capable_ship)
@ -824,6 +829,22 @@ static void ui(bool draw, double dt, double width, double height)
} }
} }
// zooming zoomeasy
{
double alpha = 1.0 - clamp01(zoomeasy_learned);
set_color_values(1.0, 1.0, 1.0, alpha);
sgp_set_image(0, image_zoomeasyhelp);
cpVect draw_at = cpv(width * 0.25, height * 0.5);
transform_scope
{
scale_at(1.0, -1.0, draw_at.x, draw_at.y);
pipeline_scope(goodpixel_pipeline)
draw_texture_centered(draw_at, 200.0);
sgp_reset_image(0);
}
}
}
// draw pick new box type menu // draw pick new box type menu
static double pick_opacity = 0.0; static double pick_opacity = 0.0;
{ {
@ -2233,10 +2254,6 @@ static void frame(void)
} }
} }
// gold target
set_color(GOLD);
draw_filled_rect(gs.goldpos.x, gs.goldpos.y, 0.1, 0.1);
// instant death // instant death
set_color(RED); set_color(RED);
draw_circle((cpVect){0}, INSTANT_DEATH_DISTANCE_FROM_CENTER); draw_circle((cpVect){0}, INSTANT_DEATH_DISTANCE_FROM_CENTER);
@ -2339,6 +2356,7 @@ void event(const sapp_event *e)
} }
if (e->key_code == SAPP_KEYCODE_TAB) if (e->key_code == SAPP_KEYCODE_TAB)
{ {
zoomeasy_learned += 0.2;
if (zoom_target < DEFAULT_ZOOM) if (zoom_target < DEFAULT_ZOOM)
{ {
zoom_target = DEFAULT_ZOOM; zoom_target = DEFAULT_ZOOM;

@ -365,8 +365,6 @@ typedef struct GameState
uint64_t tick; uint64_t tick;
double subframe_time; // @Robust remove this, I don't think it's used anymore double subframe_time; // @Robust remove this, I don't think it's used anymore
cpVect goldpos;
Player players[MAX_PLAYERS]; Player players[MAX_PLAYERS];
EntityID suns[MAX_SUNS]; // can't have holes in it for serialization EntityID suns[MAX_SUNS]; // can't have holes in it for serialization

Loading…
Cancel
Save