Better collision detection and a keyboard question

Hi all

I've pretty much finished my first game this weekend, a sideways shoot'em up endless scroller - 'space' bar takes the main character up, and he drops if 'space' is up by using a move down when space not pressed function. I'm not using gravity

All's well with this, until I get the character to fly upwards into a powerup box using space, whereby the main character graphic changes to show the new power up (i.e. character with gun). If space is held down whilst the character hits the power up an changes to the new image with the gun, the fact that space is held down isn't being instantly picked up by the game, resulting in a brief drop due to the move down if space is not pressed function, which if there are enemies around to colide with causes a loss of life. Any ideas how I can get round this?

Finally sprite collision - I'm using the standard collision attribute in Gamesalad, and tried it as both rectangle and circle, but due to the main sprite having big ears poking upwards a fair way off of his main sprite body its not working well, can anyone point me in the right direction for better sprite collision?

thanks

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    If space is held down whilst the character hits the power up an changes to the new image with the gun, the fact that space is held down isn't being instantly picked up by the game, resulting in a brief drop due to the move down if space is not pressed function
    If you're just using a rule that says When space key is down --> Move [up]; Otherwise --> Move [down] then there shouldn't be any delay when you collide with a powerup actor.

    You'll need to post your rules so we can see how you have this set up.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • Neil TNeil T Member Posts: 25
    thanks for the reply - I'm using the rule 'actor receives event' Key - 'Keyboard' - is 'down' 'move' etc

    Is there a better way to allow for this?

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    I'm guessing that your rules are more complex than just When key is down --> Move, because otherwise you wouldn't be having the problem you're having when two actors collide.

    Is it possible for you to post a link to download your project file (please .zip it first) or send me the link via private message?

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • Neil TNeil T Member Posts: 25
    thanks for the offer, the rules are fairly simply, just changing graphics on collecting powerups, killing off the player if he collides with enemy etc.

    I'm going to build a very basic level using the move up command this eve and see if it works without all the other rules and attributes.

    I'll keep you posted

    thanks

    Neil
  • Neil TNeil T Member Posts: 25
    just dropped you a link of a very quick demo to show the problem
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    I send you a PM... the file wouldn't open.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • Neil TNeil T Member Posts: 25
    I send you a PM... the file wouldn't open.
    ok, I'll test it tonight, and drop you a message, should have been ok though. I'm using the latest version of GS Creator on MacOSX.




Sign In or Register to comment.