You know if any sprites has move NAME getv etc.
Rather it has ifhitweapon or not it doesn't make any difference.
They get tossed a short distance depending on explosion force if you hit them with RPG, PIPEBOMB etc.
it will get tossed (thrown) from an explosion while is moving but not tossed if not moving.
Is there a code to put in a custom moving sprite so it doesn't get tossed when it get hit by exploding projectiles?
Page 1 of 1
moving sprites getting tossed by explosions is there a code to make it not get tossed?
#1 Posted 30 May 2014 - 04:45 AM
#2 Posted 30 May 2014 - 07:29 AM
I still don't know which sprites are you talking about. Can you give some examples?
#3 Posted 30 May 2014 - 11:34 AM
I'm sure you have way more con coding knowledge than I do but I'll offer a suggestion anyway.
add the line move stayput 0
In the area of code where you check for weapon hits
ifhitweapon
{
ifwasweapon RADIUSEXPLOSION
{
move stayput
}
else .....
You probably have other lines and brackets in and after the ifwasweapon line but I kept it short for the example. I haven't tried it but it might work. Maybe its all for nothing if hardcoded behavoir overwrites this.
EDIT: It might work because I tried it out on a custom enemy of mine that would move away when getting kicked. Now it stays in place while I'm kicking.
add the line move stayput 0
In the area of code where you check for weapon hits
ifhitweapon
{
ifwasweapon RADIUSEXPLOSION
{
move stayput
}
else .....
You probably have other lines and brackets in and after the ifwasweapon line but I kept it short for the example. I haven't tried it but it might work. Maybe its all for nothing if hardcoded behavoir overwrites this.
EDIT: It might work because I tried it out on a custom enemy of mine that would move away when getting kicked. Now it stays in place while I'm kicking.
This post has been edited by Mark.: 30 May 2014 - 12:38 PM
#4 Posted 30 May 2014 - 01:53 PM
I reread the OP and I understand the problem now. Mark's solution will make the sprite stop moving after the explosion. That might not be what he wants, since the problem involves sprites that are already moving...he might want them to continue their motion without being affected by the explosion.
#5 Posted 30 May 2014 - 03:24 PM
Trooper Dan, on 30 May 2014 - 01:53 PM, said:
I reread the OP and I understand the problem now. Mark's solution will make the sprite stop moving after the explosion. That might not be what he wants, since the problem involves sprites that are already moving...he might want them to continue their motion without being affected by the explosion.
What if it get hit during when it moves up or down will it get stopped?
Thing is I want so when it get hit while it moves, it continue moving but doesn't get tossed away from the radius.
#6 Posted 30 May 2014 - 04:19 PM
My simple move solution only stops horizontal movement. Because your sprite is moving vertically it might work. Its simple enough to easily try.
This post has been edited by Mark.: 30 May 2014 - 04:20 PM
#7 Posted 30 May 2014 - 07:12 PM
Mark., on 30 May 2014 - 04:19 PM, said:
My simple move solution only stops horizontal movement. Because your sprite is moving vertically it might work. Its simple enough to easily try.
Ok I'll try since my thing strictly goes vert up and vert down.
PS
tried and it doesn't work.
This post has been edited by Zaxtor: 30 May 2014 - 07:30 PM
Share this topic:
Page 1 of 1