forked from alemart/opensurge
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated invincibility/turbo timer to 20 seconds
- Loading branch information
Showing
3 changed files
with
9 additions
and
11 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/* | ||
* Open Surge Engine | ||
* player.c - player module | ||
* Copyright (C) 2008-2012, 2018, 2019 Alexandre Martins <[email protected]> | ||
* Copyright (C) 2008-2012, 2018-2021 Alexandre Martins <[email protected]> | ||
* http://opensurge2d.org | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
|
@@ -69,14 +69,14 @@ | |
((x) / 57.2957795131f) | ||
|
||
/* public constants */ | ||
const int PLAYER_INITIAL_LIVES = 5; /* initial lives */ | ||
const float PLAYER_MAX_TURBO = 23.0f; /* turbo timer */ | ||
const float PLAYER_MAX_INVINCIBILITY = 23.0f; /* invincibility timer */ | ||
const int PLAYER_INITIAL_LIVES = 5; /* initial lives */ | ||
|
||
/* private constants */ | ||
static const int PLAYER_MAX_STARS = 16; /* how many invincibility stars */ | ||
static const float PLAYER_MAX_BLINK = 2.0f; /* how many seconds does the player blink if he/she gets hurt? */ | ||
static const float PLAYER_UNDERWATER_BREATH = 30.0f; /* how many seconds can the player stay underwater before drowning? */ | ||
static const int PLAYER_MAX_STARS = 16; /* how many invincibility stars */ | ||
static const float PLAYER_MAX_BLINK = 2.0f; /* how long does the player blink if he/she gets hurt, in seconds */ | ||
static const float PLAYER_UNDERWATER_BREATH = 30.0f; /* how long can the player stay underwater before drowning, in seconds */ | ||
static const float PLAYER_TURBO_TIME = 20.0f; /* super speed time, in seconds */ | ||
static const float PLAYER_INVINCIBILITY_TIME = 20.0f; /* invincibility time, in seconds */ | ||
|
||
/* private data */ | ||
static int collectibles; /* shared collectibles */ | ||
|
@@ -309,15 +309,15 @@ void player_update(player_t *player, player_t **team, int team_size, brick_list_ | |
|
||
/* update timer & finish */ | ||
player->invincibility_timer += dt; | ||
if(player->invincibility_timer >= PLAYER_MAX_INVINCIBILITY) | ||
if(player->invincibility_timer >= PLAYER_INVINCIBILITY_TIME) | ||
player_set_invincible(player, FALSE); | ||
} | ||
|
||
/* turbo speed */ | ||
if(player->turbo) { | ||
/* update timer & finish */ | ||
player->turbo_timer += dt; | ||
if(player->turbo_timer >= PLAYER_MAX_TURBO) | ||
if(player->turbo_timer >= PLAYER_TURBO_TIME) | ||
player_set_turbo(player, FALSE); | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters