I am having trouble with losing health when touched by my enemy in my project. Can I please have some help?
Offline
That's a pretty vague question, as there are a lot of different ways to do that. It'd also be helpful to explain what you've already tried. Can you explain a little more?
Last edited by Harakou (2010-08-02 18:51:07)
Offline
Ok, I uploaded the project but am not sure how to create a link to it. Sorry I am new to Scratch.
Offline
So when Gobo touches the robot, he goes back to his starting position and loses a bar of health? If that's the case, then your problem is that Gobo broadcasts the health change, but the health bar doesn't have a script to change it. Try this in the health bar's scripts:
When I receive Health Next Costume If costume # = 4 Game over scripts EndIf
Offline
No problem! You can just copy and paste the link from the top of your browser window or click on the blue BBCode link to do all kinds of cool stuff. I'm not gonna get all into that though someone else probably will.
1. take out both Move 10 steps blocks
2. in the Forever if touching sprite2 add a "set velocity y to 0" block after the Hide block
3. for the health bar's script..
When I receive health
next costume
I would also recommend against using too many When green flag clicked blocks, especially in the same sprite's script. For example, the "Forever if touching sprite 2" blocks could be included in a regular If loop inside the main script.
Step 2. will eliminate some of the "falling through the floor" To fix the rest, stop Gumbo from going so far off the left and right sides.
Looking cool so far! And I love the smooth movement and jumping action, especially once you remove those unneeded Move 10 steps blocks.
Last edited by Locomule (2010-08-02 21:00:52)
Offline
Ok That works I will finish my game and upload it soon Thanks for all the help!
Offline
Harakou wrote:
So when Gobo touches the robot, he goes back to his starting position and loses a bar of health? If that's the case, then your problem is that Gobo broadcasts the health change, but the health bar doesn't have a script to change it. Try this in the health bar's scripts:
Code:
When I receive Health Next Costume If costume # = 4 Game over scripts EndIf
Dang, you beat me too it!
Offline