Collision!
dade6
Member Posts: 13
Hi everybody
Can I collide more complex form then a square or a circle?
Sorry for my bad English
Can I collide more complex form then a square or a circle?
Sorry for my bad English
Comments
but here is a brief synopsis of what to do:
- First create an invisible rectangular actor.
- Place it on the scene overlaying the sword of your main character
- resize it and rotate to fit.
- now double click it and check its x and y positions
- then double click your characters x and y positions
- work out how far apart they are and constrain the attributes self.position.x and y of the invisible rectangle to that of the main character + the difference between them worked out above. As the character moves it should now 'stick' in the right place.
- then when whatever event triggers the sword swing is true create rules in the invisible rectangle to move to new positions and then back, this will take some trial and error to match the animation correctly. (Perhaps don't have the rectangle as invisible when setting this up, make it invisible afterwards).
- make rules to destroy enemies when they collide with the rectangle. Even better add a rule that the rectangle must be in motion to destroy them.
Sorry I can't write it all out or make a project, time is short at the moment. If this all makes no sense at all then perhaps try something a little simpler first.
Stu