Need help where to start

Hello to all. I am newbie at BGE and scripting. I have an idea of simple mini-game, there are lot of tutorials for BGE to create simple fps or arcade games but my idea isn’t very typical and didn’t found any tutorials how to realize this idea or even where to start.
Idea is simple. I have character and animation for him. Animation is gymnastics performance. So i want to make this animation to be interactive. Player must press right buttons in right moments to be able to watch animation to the end. If player make too much mistakes - pressing wrong keys or in wrong time animation is stoped and then activated “falling”“stumbling” animation - so game over or started from beginning, If player managed to play animation to the end by pressing right keys in right time or made allowed amount of mistakes (let’s say less than 5 mistakes) then he should be rated depending on mistakes he made. And then player is moving to another level. To let player know when and what keys to press at given time (frames) there should appear thumbnails telling player what key in what moment to press.
That’s it. Idea is very simple but if you know nothing about scripting it’s really difficult find needed tutorial to implement your ideas or even where to start. That’s why i have made this thread, hoping that someone will help me or point out for good tutorials to realize my idea.

Sorry for my bad english. It’s not my native language.

I’m not sure, but I think you could start with actuators, or messages, try to accommodate logic bricks so that it sends a message with the key that you have to press and when you press it to register the pulse, then send another message with a new key, I never have fact, I really do not know if what I say is correct, but you could try it while I think about something else and send me the feedback

lets be honest, complex animations arent the bge’s strong point.

but im pretty sure its doable, and be easiest in python since alot of timing calculations will be needed.

the hardest part will be making all the animations so they can line up in game.

or, BluePrintRandom might have some ideas how to do this with a ragdoll setup. he tends to like going against the odds.

try this simple method:
download the attachment and unzip it, when you play try follow the instructions messages, if a red message appear telling you to press a key ( space bar or L shift) press the key or you lose

Attachments (5.79 MB)

do you have any programming knowledge? if the answer is no, use logicbricks. use a logicbrick for every action and some timers.
if the answer is yes, check this site:

in the python and logic bricks section you will find many code you can copy and paste. it gives you the simple functionality of the logic bricks but also the influence of coding.

nice attachment good method and perfect animation, you are my hero forever

_Não tenho como ajudar, mas gostaria de dizer que gostei muito das animações. Valeu!

Thank you very much. You are my saviour. This beautiful and (what more important for newbie) easy template is exactly what i want to get. Now i am gonna recreate whole scene from zero learning from your example to understand better how logic bricks are working and then will try apply this method to my very first project! Hope for some newbies like me this example will help too in their projects. Thank you one more time!

Thank you for links, i will learn from that site. Nope i have no programming knowlege at all, I always used to be 3d artist not programmer. But it’s real fun to make your models and animations a bit interactive! That’s why i am here to learn basics of BGE and maybe python language a little.

Yay, i’ve managed to recreate your example and all is working nice! However i’ve noticed one thing. If you will press spacebar before text “press spacebar” appears and will keep holding it - it won’t be count as ‘mistake’. It’s a bit lowering difficulty for player. Is there way to make that if you press spacebar or any other key before given time it will be counted as mistake and “stumble action” is activated?

well i’m sorry i forgot you are newbie with BGE in my previous attachment i was busy so i did made the .blend fast, that’s why it’s kind of a mess.

in this new attachment i wanted to introduce you to the power of States.
in this .blend:
if a red message appear telling you to press a key ( space bar or L shift) press the key or you lose, if you press the wrong key you lose and if you press keys in wrong time you lose

how it work:

i made 4 states, a state for playing animation and one for pressing Spacebar and one for pressing LShift and a state for playing lose animation

i attached an always sensor ( with Level checked ) to play the animation in first state and in Space-bar and L Shift states, the actuators ( action ) that play animation must be with ( Continue) checked to continue the animation when the state is changed
the always sensor is attached to texts Visibility actuators to always hide the texts

i attached property’s sensors ( with Level checked ) to ( or ) controller to change the states in certain value of animation.

when the state is changed to Spacebar or LShift states:

always sensor will trigger text Visibility actuators and make the text visible

a delay sensor will trigger states actuator and change the state to lose state, the player must press the key to back to first state before the delay ( i make it 60 ) change the delay to what you want, it’s just to leave enough time to read the text.

keyboard sensors ( with Tap checked ):
correct keyboard sensor will trigger states actuator and change the state to animation state

wrong keyboard sensor will trigger states actuator and change the state to lose state

i made this method easy enough for newbies with BGE, after learning bge create your own method, if you want more help please ask
good luck to you

Attachments (5.79 MB)

the text say hold key but it should be saying press key

it’s fixed now:

Attachments (5.79 MB)

this attachment helped me a lot, what about you CYNIC78 did this attachment helped you? please tell us

Hello Jack! Yes, laifa examples helped me enter to BGE logic. Now i understand how actuators are working, Or how to set up logic bricks to achieve your goals. But more you understand more questions you meet.

Thank you for your efforts to help newbie like me! Your example gave me impulse to get into logic bricks seemed to me before like something difficult. Now i am getting better with it. I have managed to recreate your examples and all is working great. I followed few tutorials on youtube and got how to set up score system, so now every successfully pressed key is sending message to text object to add 1 point to score. And its working! Another thing i want to do is modify a bit messages to player which key and when he should press. Instead text with visibility switch i am trying to make similar to “game hero” system. Player must press needed key while visible HUD object (sphere) is passing through other visible object. When key is pressed there is adding invisible object (cube) and when sphere is touching cube - sphere is removed and sended message to text to update score +1. And if player missed and sphere is passed by its touching another invisible object and then state “stumble” is activating - game over - restart. And i am planning to create four such sytems (4 spheres 4 cubes ect.) for 4 keyboard keys - just by copying and changing attributes, keys, messages and properties. So if i want to use long animation, only thing i have to do is to add enough spheres in x axis to fill whole time as animation lasts., without bothering about each time adding new logic brikcs with lot of properties.

I am not sure if i explained well enough but this is very simple system similar to “guitar hero” game. So i have two problems now. I would like to create score system for “mistakes” lets say i want to let player to make 3 mistakes before game is over, each mistake will give penalty at final score. Problem is that in our example very first mistake is ending game. How to set up system to launch stumble animation after 2 mistakes? And it would be cool when player is missed ‘right’ key then some short action is played - like if character is confused and then main action is continued at same point. So how to interrupt action with other action and then continue playning first action from intteruption point?
And very last question. I would like to make all those “trigger” spheres moving from right to left in lower part of screen. But i dont want them to appear in very right side, but instead want them appear near center of screen, so how could i “mask” part of the overlayed scene where those spheres are?

you want to make it like this?

Yes, i want system similar to this one. But i want this system as overlaeyed scene as part of HUD. Maybe i will place “fretbar” horizontally in bottom of screen. I think this system would be more flexible than bother with visibility of text and setting up sensors at needed frames. At this system i will need only to place “notes” on “fretbar” and it could be easily adapted\edited to other scenes\levels without lot of work - just change position of “notes” on fretbar - increase speed and thats it - more difficult levels are ready.

i don’t know if i really did understand what you need so please test this attachment and tell us
in this attachment i made 3 keyboards ( Q,W,E ) player must press keys when he see object (Sphere) enter in collision with object (Torus) of the same color( a cube of the same color will be visible in very short time press key when you see it ), if you press key in wrong time it interrupt action and ops animation is played. then the animation continue from interruption point

the problem is the animation continue from interruption point only in some older versions of blender like blender 2.70 ( you can download it here: 32bit: 32 bit download 64bit: 64 bit download other 2.70 download: blender 2.70 download links )
in the other blender versions the animation restart from beginning so download blender 2.70 and open this attachment with it, test it and if you need more help ask us, good luck to you


gymnastics_blender (11.6 MB)

when object Sphere is added it keep add and add need to add time to end object Sphere or something

i update it, i added cube to remove Sphere in collision


gymnastics_blender (11.6 MB)

Thank you guys for helping me. I have made simple HUD system similar to laifa made but in horizontal position and two scores - like “hit” and “miss”, and spheres representing keys instead using gravity now are parented to empty wich has ‘always’ sensor connected to ‘move’ actuator - to control speed of spheres. It’s working like i wish but i have problem. When i duplicate my spheres to place them on “fretbar” my system fails - every time you hit needed key its always counted as “hit” in my counter and at same time as “fail”. I will try to upload my blend file it would be cool if you look at it and tell me where is mistake. Just try to play and it should be fine. But then just duplicate round keys(buttons) and try play again - score system is broken - “miss” score is always counted even if you press right way. :frowning:


Test.blend (706 KB)