I want to make a 2d RPG game that contains fighting monsters.
This is what i need help in :
I want player to attack, and it must go near to the monster to attack it like games like a arcade fighter games.
Thanks in advance
Offline
Medic wrote:
[when <arrow key> pressed]
[wait until touching <monster>
[switch to costume <attack>]
I hope this helped.
I think a better one would be:
[when arrow key pressed] or [when [attack]recieved] (like with a broadcast)
[glide (x) seconds to (x position of monster) (y position of monster)]
[switch to costume <attack>]
[change <monster health> by (- attack power)]
[glide (x) seconds to (previous x position) (previous y position)]
Offline
Well if you have an attacking person you could do this
when green flag clicked
set attacking(a variable) to 0
forever start
if (attack button) pressed
set attacking to 1
(optional animation sequence)
switch to costume slash1
wait 0.05 sec
switch to costume slash2
wait 0.05 sec
switch to costume slash3
(end of animation sequence)
set attacking to 0
forever end
put that script under the person who attacks
for the monster you could do this
when green flag clicked
forever start
if touching color (the color of the tip of the blade) and attacking = 1
change health (his health variable) by attack damage (damage variable)
wait 0.3 seconds
forever end
note the health variable should be just for the monster sprite, not for every sprite. while the attacking and the damage and attacking variable should be for every sprite.
this is for if your walking around on a 2d game, non isometric, and you walk on a platform. It only works if he actually turns left and right. not just moves.
this is an example of where it would work on.
let's say they couldn't shoot and could only hit each other with their guns. The guy on the left (assuming you have movement) would move towards the guy on the right. when you press the attack button he puts his hand up and very quickly slashes it down (that would be the animation sequence) and that would deal damage
hope this helps
Offline