No coins means game over!

Hey, I am currently working on a game where you are a ball in space and you collect coins. I’ve been doing good so far, but now I’ve come to a certain part in the game where I really need a python script, DARN! Well I guess im asking for a script that will go to a different scene whenever I collect all of the items colectable. Yes, I know im asking alot. But I hope somebody is making or has made a ball game similar to mine and would share this sript with me. For now I do not want to give the file away cause im planning on ACTUALLY FINISHING this game, lol. But if you need to view the file just send me a message. Thanks:)

Or if there is an easier way that would be great too.

What I’d do uses no python:
you could have a property “counter”, starting at the number of coins there are. when a coin is collected, it sends a message to that object before ending itself, and when that object gets that message, it reduces the counter by one. when the counter=0, the scene changes.
be aware that in the current blender there’s a bug that the message actuator sends 2 pulses when it’s fired, so compensate.

I hope that made sense…

Ok I think I know what your talking about. I thank you for that. But I’m not sure how to set up a property counter and all that good stuff. I would be very thankful for a tutorial. :slight_smile: thanks

This might work … might not. But set up a touch sensor on all coin. Like this
Touch-----------------And-------------Edit Object (End Object)
…_______Property (Add) (Prop: plus_one) (Value: 1)

Have that connect to each coin
Property (Equal) (Prop: plus_one) (Value: 10)–And–Scene (set scene: Scene.001)

10 is for the number of coins on the scene
property plus noe needs to be initialize as zero. I think this will work but have not used pretty much any of it before so I’m not sure.

Getting ready to try, thanks. :slight_smile:

Still acepting Captian Oblivon answer.

try this file:
press P to play (duh)

look at the setup on the player and any given coin. I named the logic bricks that really matter to this file, the others are just movement and such (yes, I’m lazy, so sue me)

Thanks that clears things up! :slight_smile: and you seemed mad about being lazy. So im just letting you know i wasnt rushing you by saying that im still acepting I just thought that jessegp theory would work :slight_smile:

im asking way too much here…

ok ive been going at both of your theorys for about 2 hours by now and nothing is really working. If somebody is in a REALLY good mood. Will you ( ah this is pathetic) please pretty much…uh…walk me through all of this…:o

i’ll send u the file if you want to help


The answer to your question is in the Blender Games Sticky. Download the first set of zip files and study “Health Scenes”. What you are trying to do is save your information as a Global variable and load it at the beginning of the new scene. The game is buggy and old (sumo), but the scripts still work fine. Also, study the “save/load script” because it hold the ability to save the game and load that info. If you are unsure about python scripting now is the time to start. It opens a whole new world to you.
And for python:
A Byte of Python : Introduction