This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2010-05-03 21:16:37

JNet
Scratcher
Registered: 2010-05-02
Posts: 21

Calculating Score (based on deaths)

I'm working on a game where your final score is based on the amount of deaths accumulated over the course of the game. What would be the best way to calculate the score without it being too punishing? I don't want it to ever go below 0.

I tried using this formula:

round(1 / (Amount of Deaths + 1) * 10000)

It ended up returning too steep consequences for the deaths. Help, please?

Offline

 

#2 2010-05-04 17:19:14

Ratty1967UK
Scratcher
Registered: 2007-05-16
Posts: 88

Re: Calculating Score (based on deaths)

so what sort of penalty per death did you have in mind?

the formula you've used is a reciprocal function and isn't linear so will penalise the first death by halving your score, subsequent deaths won't penalise you quite so much.

Offline

 

#3 2010-05-04 19:18:15

laser100
Scratcher
Registered: 2009-12-04
Posts: 100+

Re: Calculating Score (based on deaths)

Try http://scratch.mit.edu/projects/laser_100_test/1028047

Offline

 

#4 2010-05-05 00:24:36

JNet
Scratcher
Registered: 2010-05-02
Posts: 21

Re: Calculating Score (based on deaths)

Ratty1967UK wrote:

so what sort of penalty per death did you have in mind?

the formula you've used is a reciprocal function and isn't linear so will penalise the first death by halving your score, subsequent deaths won't penalise you quite so much.

I want a linear function that calculates the score. The problem with doing that was getting a negative score if you had a sufficient number of deaths.

Offline

 

#5 2010-05-05 07:11:55

laser100
Scratcher
Registered: 2009-12-04
Posts: 100+

Re: Calculating Score (based on deaths)

JNet wrote:

Ratty1967UK wrote:

so what sort of penalty per death did you have in mind?

the formula you've used is a reciprocal function and isn't linear so will penalise the first death by halving your score, subsequent deaths won't penalise you quite so much.

I want a linear function that calculates the score. The problem with doing that was getting a negative score if you had a sufficient number of deaths.

You could make it : if score is less than 0, set score to zero.

Offline

 

#6 2010-05-05 08:04:01

onedudeuk
Scratcher
Registered: 2009-01-11
Posts: 100+

Re: Calculating Score (based on deaths)

or if 2x [score] = lessthan [score] set score to zero. But lasers way is easier!


http://i.imgur.com/1FaX3.gif
http://i.imgur.com/yu0s1.gif

Offline

 

Board footer