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->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
{
for (size_t i = 0; i < MAX_PLAYERS; i++)
@ -2374,13 +2372,6 @@ void process(struct GameState *gs, double dt)
#ifdef INFINITE_RESOURCES
p->damage = 0.0;
#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
cpVect world_hand_pos = get_world_hand_pos(gs, &player->input, p);
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 double rotation_learned = 0.0;
static double rotation_in_cockpit_learned = 0.0;
static double zoomeasy_learned = 0.0;
typedef struct KeyPressed
{
bool pressed;
@ -121,6 +122,7 @@ static sg_image image_missile;
static sg_image image_missile_burning;
static sg_image image_rightclick;
static sg_image image_rothelp;
static sg_image image_zoomeasyhelp;
static sg_image image_gyrospin;
static enum BoxType toolbar[TOOLBAR_SLOTS] = {
@ -648,6 +650,7 @@ static void init(void)
image_rightclick = load_image("loaded/right_click.png");
image_rothelp = load_image("loaded/rothelp.png");
image_gyrospin = load_image("loaded/gyroscope_spinner.png");
image_zoomeasyhelp = load_image("loaded/zoomeasyhelp.png");
}
// socket initialization
@ -805,22 +808,40 @@ static void ui(bool draw, double dt, double width, double height)
if (draw)
sgp_push_transform();
// rotation helper
// helpers
if (draw)
{
double alpha = 1.0 - clamp01(rotation_learned);
if (piloting_rotation_capable_ship)
alpha = 1.0 - clamp01(rotation_in_cockpit_learned);
set_color_values(1.0, 1.0, 1.0, alpha);
// rotation
{
double alpha = 1.0 - clamp01(rotation_learned);
if (piloting_rotation_capable_ship)
alpha = 1.0 - clamp01(rotation_in_cockpit_learned);
set_color_values(1.0, 1.0, 1.0, alpha);
sgp_set_image(0, image_rothelp);
cpVect draw_at = cpv(width / 2.0, height * 0.25);
transform_scope
sgp_set_image(0, image_rothelp);
cpVect draw_at = cpv(width / 2.0, height * 0.25);
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);
}
}
// zooming zoomeasy
{
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);
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);
}
}
}
@ -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
set_color(RED);
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)
{
zoomeasy_learned += 0.2;
if (zoom_target < DEFAULT_ZOOM)
{
zoom_target = DEFAULT_ZOOM;

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

Loading…
Cancel
Save