Created
January 14, 2017 15:41
-
-
Save codetravis/5a6c6bca5695865349c2af127a1de704 to your computer and use it in GitHub Desktop.
12.2 Tell projectiles to collide with the player character and damage it
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' CustomEngine class | |
Method OnObjectCollision:Int(obj_one:ftObject, obj_two:ftObject) | |
If (obj_one.GetText() = "PLAYER" And (obj_two.GetText() = "ENEMY" Or obj_two.GetText() = "FINALBOSS")) | |
CharacterCollision(obj_one, obj_two) | |
Else If (obj_two.GetText() = "PLAYER" And (obj_one.GetText() = "ENEMY" Or obj_one.GetText() = "FINALBOSS")) | |
CharacterCollision(obj_two, obj_one) | |
End | |
'Update projectile collision to check for collision with the player | |
If (obj_one.GetText() = "PROJECTILE" And | |
(obj_two.GetText() = "ENEMY" Or obj_two.GetText() = "FINALBOSS" Or obj_two.GetText() = "PLAYER")) | |
ProjectileCollision(obj_one, obj_two) | |
Else If (obj_two.GetText() = "PROJECTILE" And | |
(obj_one.GetText() = "ENEMY" Or obj_one.GetText() = "FINALBOSS" Or obj_one.GetText() = "PLAYER")) | |
ProjectileCollision(obj_two, obj_one) | |
End | |
Return 0 | |
End |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment