For the gun, you'll need an image/animations of your character holding a gun. Same thing for the sword. Even if you DON'T have these graphics yet, you can already start. Just create a Game Integer attribute called Weapons, and set it to 1. Now, tell your actor that you can press (anybutton) to change attribute Weapons from 1 to 2, and vice versa. Now tell your actor that when "game.attribute.weapons"=1, change image to your actor with a gun. Copy the rule, but change the 'game.attribute.weapons" to 2, and change image to your actor with sword.
SlickZeroHouston, TexasMember, Sous ChefPosts: 2,870
Whenever you press a button to swing at something, have an invisible actor offscreen, and interpolate its position to the x and y of the actor, and interpolate back offscreen when the button is released. You'll have to use offsets to get it positioned wherever the sword is when you swing. And have rules for damage, death etc in any other actor that is affected by sword damage when they collide with that invisible actor.
So I would have to stick a invisible actor in front of my enemy?
SlickZeroHouston, TexasMember, Sous ChefPosts: 2,870
No, it's depending on how the actor uses the sword. If it's a stabbing motion, you would use a rectangular actor that is sitting offscreen, and when you press whatever button that makes him stab (and I assume it has an animation for that sword attack) you'd interpolate that invisible actors position to the main actors x, and y position, but you will also have to use an offset to the x and y so the invisible actor is laying over the same place that the sword is when it is sticking out.
That's one way to do it, you could also use magnitude when you press the button to attack, but that's too complicated for me to explain since I can barely do it half the time, and it sounds like you aren't ready for that just yet.
Comments
That's one way to do it, you could also use magnitude when you press the button to attack, but that's too complicated for me to explain since I can barely do it half the time, and it sounds like you aren't ready for that just yet.