realbasic-games
[Top] [All Lists]

Re: extra sprite?

To: REALbasic Games <realbasic-games at lists dot realsoftware dot com>
Subject: Re: extra sprite?
From: Nick Lockwood <nick at charcoaldesign dot co dot uk>
Date: Wed, 30 Jun 2004 19:30:54 +0100
Delivered-to: realbasic-games at lists dot realsoftware dot com
List-help: <mailto:realbasic-games-request@lists.realsoftware.com?subject=help>
List-id: REALbasic Games <realbasic-games.lists.realsoftware.com>
List-post: <mailto:realbasic-games@lists.realsoftware.com>
References: <a06100500bcff0a031c3b at [66 dot 52 dot 106 dot 63]> <94A5676C-CA12-11D8-8D48-000393B48432 at optonline dot net>
Depending on the arc of your sword you could simply check if the enemy is 'in front' of the player when they collide by checking their relative x/y positions. If the enemy is in front of the player and a collision is registered when the player is swinging the sword then you could assume that the enemy has been hit by the sword.

Nick

Hi, I'm working on a simple game, and I want the main character (a sprite) to attack with a sword when the user presses a button. Any enemies touching the sword should do a method (getting damaged or something), but any enemy touching the character and not the sword should not do this method. One way to solve this problem would be to simply make an extra sprite, so the character would be one sprite, and the sword would be a separate one. Is there any easier way of doing this?

_______________________________________________
Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>