How do i... deal damage?
mike206
Member Posts: 24
ok so thanks to you guys I got my dragon shooting perfectly and just gave it a cool shooting sound effect. I also figured out how to destroy on touch/click (new video with all this coming soon) so now does anyone know how to give damage to player and boss? I wanna do it so if player destroys laser before the line aka to early or if it hits them they take damage but if they destroy laser on that vertical line you see in this video the boss takes damage. Thanks everyone
Comments
ok so I got it down to the point I can destroy the laser and deal damage but as you can see from the new video below that I just made I can click anywhere and the laser is destroyed. I just want it so only when the laser is touched it gets destroyed. anyone know how I can fix this? thanks
Not knowing anything about how you have your rules set up right now, id say:
Make a rule on the laser actor That says:
When touch is pressed, destroy actor.
But having a screenshot of your current destroy rules would be very helpful.
Mental Donkey Games
Website - Facebook - Twitter
@NipaDidIt yeah I thought so. ok let me work on that so people can see it
Ok this is what my rules look like so far @NipaDidIt
@mike206 You need to change your Rule from "when mouse is down -- destroy actor" to making a "when touch is pressed -- destroy actor" on your laserbeam actor. This way only the laserbeam will get destroyed if someone taps it, and not anywhere on the screen.
Mathtap.com (Android) | Fridgemanager.com (Android) | Breakoutofspace.com (Android)
@Summation yeah awesome! thanks, that worked perfect!
Ok so I have it when the vertical line you see is tapped the boss takes damage but it happens anytime I click on it. I want it so only when the laser is destroyed at the point of contact with the line then boss takes damage. You can see in the video and the pic has the rule I got set so far. Any help would be great! Thanks everyone
I've merged your three threads. Please don't keep creating new threads each time you have additional information to provide. Just post a reply to your existing thread (this one).
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
@mike206 Why not try rearranging your Rule to:
When your vertical line overlaps/collides with your Missle...
(nested) Rule: when touch is pressed -- change boss health
Mathtap.com (Android) | Fridgemanager.com (Android) | Breakoutofspace.com (Android)
@tatiang oh ok... sorry about that. someone mentioned do one request at a time so thought that meant I had to start a new one so people could see my new issues but thanks for clearing that up for me
will try that
I'm a complete newbie.
Glad it worked for you!
Mathtap.com (Android) | Fridgemanager.com (Android) | Breakoutofspace.com (Android)
@Summation thank you again! I got it working now. You are like the all knowing mighty one lol I appreciate the help. learning a lot that's for sure
@Summation well you're a good newbie oh hey... I wanna use an item in the game that does damage to the boss. Do you think the same way I did the on touch event for the vertical line would work if I had an image and put something like on touch show animation on top of boss and then add the attribute that deals damage? I'm thinking that might work lol but only thing is I don't want the boss to keep shooting when it's hit by the players special attack. I want it to get hit by player attack and then resume its attack afterwards so maybe some event to stop attacking event and resume after it's hit
It's a little different. You have to make the boss shoot the lasers only when the special attack is false, so maybe create a special attack attribute. If you want the boss to stop attacking for a few seconds when you use the special attack you'll have to make a timer set the special attack attribute to true for whatever time you want, then change it back to false after the timer runs out.
Mathtap.com (Android) | Fridgemanager.com (Android) | Breakoutofspace.com (Android)
Hmm... Ok that might work. I'll have to mess around with that and try it out, thanks
@Summation ok check this out! I got it so the special attack works but things that don't work is I need to have a number of how many power ups player has to use and be able to click on power up to use it again. The pics shows how I have it set up. Also the video it shows that I can click the power up anytime to use it but I only want it so when laser hits line and tap is clicked. Then I can work on stopping boss lol so if you or anyone seeing this can help that would be great
Perhaps an integer attribute that keeps track of how many special attacks you have left.
Then, if that number is greater than zero, on touch, use special attack, then subtract one from the attribute.
The idea is to only make it be able to be used if you have at least 1 left.
Mathtap.com (Android) | Fridgemanager.com (Android) | Breakoutofspace.com (Android)
@Summation yeah that might work. Do you know how I might fix the part when I tap on power up it works anytime? I wanna make it so only when laser collides with line and you tap on item it does it's effect to boss. Right now I can tap power up anytime and the power up works but only once of course till I fix that issue you suggested
Maybe a boolean like... can_use_special
By default can_use_special should be set to 0.
On your vertical line actor you can do:
if actor collides with laser, change can_use_special to 1 (else change can_use_special to 0)
then on your special attack button...
if can_use_special = 1
(nested rule) if touch is pressed
do: special attack
Mathtap.com (Android) | Fridgemanager.com (Android) | Breakoutofspace.com (Android)
@Summation ok I got it to work thanks. I just had to change it from if can use special =1 to if can use special is >1 do special. I got it so only 5 can be used and only works if hits line. Also item is destroyed after 6 uses. You have been a lot of help. Thank you very much the thing I'm stuck on now is making the boss shoot multiple lasers at a time and maybe have different speeds so it challenges player. Do you know how I can do that? I'm thinking maybe something like every certain dragon image spawn laser? But not sure how that would look haha
You're welcome!
I'm not sure right now
Mathtap.com (Android) | Fridgemanager.com (Android) | Breakoutofspace.com (Android)
Haha ok I'll try to work on it and when I figure it out I will let Cha know also
@Summation hey do you know how I can do screen shake when player gets hit by laser and flash red screen?
To flash the screen red, put a red rectangle actor above all the others in your scene with it's Alpha Value set to 0 so it will be fully transparent. When you want the screen to flash red, use a Timer and a Change Attribute Behavior to turn the Alpha Up for a short time.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page