projects
/
gbajam22
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
068bc92
)
calculate scores
author
John Tsiombikas
<nuclear@member.fsf.org>
Mon, 31 Oct 2022 22:50:03 +0000
(
00:50
+0200)
committer
John Tsiombikas
<nuclear@member.fsf.org>
Mon, 31 Oct 2022 22:50:03 +0000
(
00:50
+0200)
src/gamescr.c
patch
|
blob
|
history
diff --git
a/src/gamescr.c
b/src/gamescr.c
index
7d0e051
..
5fdfa6b
100644
(file)
--- a/
src/gamescr.c
+++ b/
src/gamescr.c
@@
-553,8
+553,20
@@
static void draw(void)
static void victory(void)
{
+ int sec, time_bonus;
+
total_time = timer_msec - start_time;
- score = 42;
+ sec = total_time / 1000;
+
+ if(sec < 60) {
+ time_bonus = 1000 + (60 - sec) * 100;
+ } else if(sec < 120) {
+ time_bonus = 250 + (60 - (sec - 60)) * 10;
+ } else if(sec < 300) {
+ time_bonus = 100;
+ }
+
+ score = energy * 250 + time_bonus;
/* TODO enter name */
save_score("???", score, total_time, 0);