How to grow actor and destroy when released
mahoward
Member Posts: 15
I'm trying to spawn an actor while holding down the mouse and then when i release the mouse button, it destroys that same actor. Also, I want to make the actor get bigger until I let it go. Can anyone explain to me how I would do this? The actor is a bomb if that helps you understand.
Comments
Please use descriptive titles for your threads (I changed it for you).
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Thanks. I suppose you don't know the answer then?
The making it bigger is something I dont know but dropping the bomb would be something like -
Create an boolean attribute on the ACTOR tab for the bomb. name it dropped. Leave it unchecked.
RULE
Then create attritube if self.dropped is false
constrain self.position.y to game.mouse.position.y
constrain self.position.x to game.mouse.position.x
Create a new rule
When mouse is DOWN
mouse position is
Create new rule
If self.dropped is true
This is where you put the direction of travel for your bomb using Accelerate or collide if its to stay on a platform or something
Dont forget to add a destroy actor attribute once its been used
Like Balls? Then click here! We've 100 coming soon
I've made you a simple demo, download it and see how it works.
Link: https://www.mediafire.com/?45i1hhk8c3zl3m3
Actually, I was making you a demo in Mac Creator. I'll post it in a moment.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Here you go: https://www.dropbox.com/s/30sqmqrvoidxml7/bomb grow.zip.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Thanks guys! One more question. Is there anyway to set a max size limit for the bomb?
Did you try my demo? It has a size limit.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
I got the size limit done, thanks. Maybe you can answer my recent question I posted.
Here is what I need help with. So far I have made it so when you click and hold, the bomb spawns and grows to 70 by 70 pixels. When you let go a blast is given and moves the character in the oppisite direction the bomb is put on. For some reason the bomb only gives an explosion once and I can't figure out how to get it to do more. I want to make it like the smaller the bomb has grown, the smaller the blast and the bigger the bomb, the bigger the blast given to the character. Also to be able to explode more than once. After it explodes once the bomb will still spawn but no blast is given. I'm tying to make this as clear as possible. It would be really great if someone can explain to me how I would do this. A demo would be amazing!
Are you using the interpolate attribute to grow the bomb? My suggestion would be to create a game real attribute and constrain the bomb size to that real attribute. Then set some parameters to the bomb. Create a rule and do something like, if self.size.height is greater than a certain size, animate and put in your explosion animation. You'll want to have a couple different size explosions so that when the bomb is in a certain size range, it will call upon the correct explosion size. Does this make sense or do I need to explain further?
Here is exactly what I followed. This is the bomb explosion and I followed the first demo given to me on this link http://forums.gamesalad.com/discussion/65712/how-to-grow-actor-and-destroy-when-released#latest I combined both of them sort of.
I will try yours but can you explain a little more on the first attribute you said.
If you've combined them, then there is probably something wrong in the code somewhere. Go back through and check it thoroughly
"I need some big help from people" is not a descriptive title for a thread. You also already started a thread for this topic, so please use that one (I'll merge them for you). You can find your existing threads by clicking on the "My Discussions" link in the right sidebar at the top of the page.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
I did that but I'm not sure what it is.