Forum
CS2D Scripts Wall Collision ExampleWall Collision Example
4 replies 1
This is a basic Version of collision detection
If you do not understand the basics as you intend to understand something more advanced, and if someone wants to help you, they must make what you are looking for compatible with what you already have.
edited 1×, last 06.07.20 01:51:19 am
I had some simple (very simple...) collision detection logic there. Not optimized or anything (except that the arrow checked for collision only on every 3rd tick (LINE 84))
You want a custom collision with an image. It's hard because:
You have to setpos (teleport) players backwards, and it will be laggy for them
Images can have arbitrary shapes - that's not easy. If your image is a rectangular or a circle only then it's simple.
And if you have too many custom collision objects, you will run into performance problems. So eventually you'd end up with AABB and other optimization techniques.
Have fun hacking!
1