Occasional programming tip #1:

Make vector types usable as arrays. It's more flexible, as it lets you express an X/Y/Z axis with a variable that you can pass into a function, or take from a for-loop.

I've found this very useful when writing UI code!

#gamedev #programming

@EeroMutka what language is this? kinda looks like c
@CIOSAI_tw It’s valid in both C and C++.
(though in C you also need an extra ”typedef union Vec2 Vec2;”)