my request
here are some fragments of the game code
if collectibletype==colt_ring then
s.score=100
end
add(entities,s)
return s
end
function collectible_update(s)
end
now if on one level I have 3 rings the same and for each ring I get 100 points
I would like to change the code to something like this
if collectibletype==colt_ring then
s.bonus+=1 end
if s.bonus=1 then s.score=100 end
if s.bonus=1 then s.score=200 end
if s.bonus=1 then s.score=400 end
so that for getting the first ring in any order there would be 100 points, for the second 200 points, third 400 points
![](/gfx/set_like0.png)
![](/gfx/top_drop.png)
![](/media/92447/Logo.png)
You might want something like this instead:
This happens for each ring you collect:
if collectibletype == colt_ring then s.bonus += 1 end |
After you collect each ring, you run this:
if s.bonus == 1 then s.score = 100 end if s.bonus == 2 then s.score = 200 end if s.bonus >= 3 then s.score = 400 end |
[Please log in to post a comment]