This code says to check if Lance is at the top half or bottom half of the box, and then check if his x/y is in the triangle in that half, then check left and right

If Lance is in a triangle then push him out at 0.5 pixels until he's clear of it

Show thread

I've optimized this code from yesterday, now instead of pushing Lance in the direction until he's out of the box and checking to see if he's still in or not, it simply snaps Lance to the outermost border of the triangle he's found in

Mastodon doesn't like the picture of the code though so here it is on Twitter
twitter.com/FxSql/status/10856

Show thread
Sign in to participate in the conversation
Mastodon

Server run by the main developers of the project 🐘 It is not focused on any particular niche interest - everyone is welcome as long as you follow our code of conduct!