# 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 &gt; 0 &lt;= 5:
a = 9
elif fails &gt; 5 &lt;= 10:
a = 8
elif fails &gt; 10 &lt;= 15:
a = 7
elif fails &gt; 15 &lt;= 20:
a = 6
elif fails &gt; 20 &lt;= 25:
a = 5
elif fails &gt; 25 &lt;= 30:
a = 4
elif fails &gt; 30 &lt;= 35:
a = 3
elif fails &gt; 35 &lt;= 40:
a = 2
elif fails &gt; 40 &lt;= 45:
a = 1
else:
a = 0

if temps &lt; 600:
b = 10
elif temps &gt; 600 &lt;= 900:
b = 9
elif temps &gt; 900 &lt;= 1200:
b = 8
elif temps &gt; 1200 &lt;= 1500:
b = 7
elif temps &gt; 1500 &lt;= 1800:
b = 6
elif temps &gt; 1800 &lt;= 2100:
b = 5
elif temps &gt; 2100 &lt;= 2400:
b = 4
elif temps &gt; 2400 &lt;= 2700:
b = 3
elif temps &gt; 2700 &lt;= 3000:
b = 2
elif temps &gt; 3000 &lt;= 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

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 &gt; 0 and &lt;= 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 &lt;= 5:
a = 9
elif fails &lt;= 10:
a = 8
elif fails &lt;= 15:
a = 7
elif fails &lt;= 20:
a = 6
elif fails &lt;= 25:
a = 5
elif fails &lt;= 30:
a = 4
elif fails &lt;= 35:
a = 3
elif fails &lt;= 40:
a = 2
elif fails &lt;= 45:
a = 1
else:
a = 0

if temps &lt; 600:
b = 10
elif temps &lt;= 900:
b = 9
elif temps &lt;= 1200:
b = 8
elif temps &lt;= 1500:
b = 7
elif temps &lt;= 1800:
b = 6
elif temps &lt;= 2100:
b = 5
elif temps &lt;= 2400:
b = 4
elif temps &lt;= 2700:
b = 3
elif temps &lt;= 3000:
b = 2
elif temps &lt;= 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.