Forum

> > CS2D > Scripts > Wall Collision Example
Forums overviewCS2D overview Scripts overviewLog in to reply

English Wall Collision Example

4 replies
To the start Previous 1 Next To the start

old Re: Wall Collision Example

cs2d_is_a_Gem
User Off Offline

Quote
Obviously it is not exactly what you are looking for, but you should start with the basics.
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

old Re: Wall Collision Example

VADemon
User Off Offline

Quote
I had written a small script here it was for a flying freezing arrow that slows down players on hits and when it hits a wall it gets removed.
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!
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview