Player blocking with a shield?

DariusSlayer

  • Posts: 223
I'm under the impression that to pull this off, I'd have to:

1.  Create a "shield" actor of the same texture/design of the player's shield.

2.  Assign a keyboard button press event that would create said shield depending on the player's position (be it while player is standing still or jumping).

3.  Remove shield when button is released

I'm only asking a brief overview of how I could pull this off, and hopefully make it work for the sword (actor) as well...

« Last Edit: March 01, 2013, 02:58:24 pm by DariusSlayer »

dtrungle

  • Posts: 1938
It really depends on the game. You can get by by changing the animation to an actor holding a shield. You then have to deal with said actor shielding when it's jumping.

twotimingpete

  • *
  • Posts: 1667
different ways of doing it. what you said is one way. or the shield could simply be an animation within the main actor, where you draw him holding a shield up. then you can add a collision box, form it aruond the shield, and have that box block things. or just make the regular character's collision group different for this animation. or whatever.

DariusSlayer

  • Posts: 223
Yea, sorry about not mentioning the type of game.  It's for a platformer and the character has a sword and shield equipped.

DariusSlayer

  • Posts: 223
Necro-bump  ;D

Still trying to figure this out, as I have tried a few sword attack behaviors from Forge, but none have worked out properly...

SpookyBurger

  • Posts: 82
How are you planing to implement the shield and sword function?  Once you've figured that out and made a rough psuedo code people will have a easier time helping you.
Please try out my latest build of Patient 9 here.   http://www.stencyl.com/game/play/23179

DariusSlayer

  • Posts: 223
Here's what I have so far (in attached pic).

DariusSlayer

  • Posts: 223
The "Sidescroller Sword Attack" behavior on Forge needs to be updated or have more info on how to either modify or use it correctly, because my attack animations won't appear and can only attack when I am moving left or right, not when I'm just standing still  :/

gruffman

  • *
  • Posts: 564
I don't see anything in your pic relating to the shield issue? I would suggest when

defend button is pressed,
switch anim to shield
create block actor at x,y co-ords( determined if player is facing left or right)

block actor should hide on create and is set to kill bullets that hit it. will kill self when defend is not pressed.

Feel free to add screens or upload current state of game.
Now available for all Android Devices - Happy Face Concentration
My Games To Date
Find A Face / Hero Of Oda / Snakes And Ladders
Hungry Monkey available at fgl.com for Sponsorship
My site - Gruffgames.com