Setting scene with Python

Hello everybody, this is my first post here, after being looking for a while I didn’t really find a post that solves my problem completely, so I thought the best way to solve it was asking for some help, since I’m stucked with this, and I think it has to be really easy to solve by an advance python user (i’m noob).

Here’s the question: I’m creating a module whose function is to calculate a punctuation from 0 to 10 at the end of a game, in accordance with the times you’ve failed and the time elapsed. I’ve already done this, so I’ve got the final mark calculated and associated to “c”. I’d like to, according with the mark you’ve got, move to a scene with a 2D plane with the mark printed on it (so I have to create 11 scenes). But how can I make this?

Here’s the module, hope you can help me. Thanks!

import bge
import puntuació
import temps_ini
import temps_fin
temps = timefin - timeini        
def puntuaciófinal(a, b): 
    return (a + b) / 2

if fails = 0:
    a = 10
elif fails > 0 <= 5:
    a = 9
elif fails > 5 <= 10:
    a = 8
elif fails > 10 <= 15:
    a = 7
elif fails > 15 <= 20:
    a = 6
elif fails > 20 <= 25:
    a = 5
elif fails > 25 <= 30:
    a = 4
elif fails > 30 <= 35:
    a = 3
elif fails > 35 <= 40:
    a = 2
elif fails > 40 <= 45:
    a = 1
else:
    a = 0

if temps < 600:            
    b = 10
elif temps > 600 <= 900:    
    b = 9
elif temps > 900 <= 1200:
    b = 8
elif temps > 1200 <= 1500:
    b = 7
elif temps > 1500 <= 1800:
    b = 6
elif temps > 1800 <= 2100:
    b = 5
elif temps > 2100 <= 2400:
    b = 4
elif temps > 2400 <= 2700:
    b = 3
elif temps > 2700 <= 3000:
    b = 2
elif temps > 3000 <= 3300:
    b = 1
else:
    b = 0

c = puntuaciófinal(a, b)

if c = 10

What should come next?

P.S: Sorry if I’m making some mistakes in writing, English is not my mother tongue :confused:

you don’t need half of the checks, as the conditions above other conditions already checked for it. For instance:

if fails == 0:
    # is fails equal to 0?

elif fails > 0 and <= 5:
    # fails is not 0, so it must be greater. As we check if it's smaller or equal to 5, we don't need to check if it's greater than 0.

import bge
import puntuació
import temps_ini
import temps_fin
temps = timefin - timeini        
def puntuaciófinal(a, b): 
    return (a + b) / 2

if fails == 0:
    a = 10
elif fails <= 5:
    a = 9
elif fails <= 10:
    a = 8
elif fails <= 15:
    a = 7
elif fails <= 20:
    a = 6
elif fails <= 25:
    a = 5
elif fails <= 30:
    a = 4
elif fails <= 35:
    a = 3
elif fails <= 40:
    a = 2
elif fails <= 45:
    a = 1
else:
    a = 0

if temps < 600:            
    b = 10
elif temps <= 900:    
    b = 9
elif temps <= 1200:
    b = 8
elif temps <= 1500:
    b = 7
elif temps <= 1800:
    b = 6
elif temps <= 2100:
    b = 5
elif temps <= 2400:
    b = 4
elif temps <= 2700:
    b = 3
elif temps <= 3000:
    b = 2
elif temps <= 3300:
    b = 1
else:
    b = 0

c = puntuaciófinal(a, b)

if c == 10

bge supports dynamic loading of meshes, you could create digit meshes (0-9) and a dot mesh (.) and load the required ones for score display, e.g.

7.5 --> “7” mesh, “.” mesh, “5” mesh. Same y coordinate, but different x (e.g. if each mesh is roughly 10 units, offset for “7” mesh could be -12, for the dot mesh 0 and +12 for the 5.