Last active
November 26, 2019 14:01
-
-
Save coelhucas/c21b9feb4318b23cc7b8563ef9dd9d13 to your computer and use it in GitHub Desktop.
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
extents KinematicBody2D | |
var is_repelling: bool = false | |
[...] | |
func _process(delta): | |
if not is_repelling: | |
for i in get_slide_count(): | |
var collision = get_slide_collision(i) | |
if (collision.collider.is_in_group("name")): | |
repel(collision) | |
func repel(collision: KinematicCollision2D) -> void: | |
var collision_body = collision.collider | |
is_repelling = true | |
# my knockback | |
# collision_body.repel(self) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment