mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-22 17:49:43 +01:00
No description
891ca527f9
Believe it or not, there are still some remnants of the ActionScript coding standards in the codebase! And one of them sometimes pops up whenever an integer division happens. As it so happens, it seems like division in ActionScript automatically produces a decimal number. So to prevent that, the game sometimes subtracts off the remainder of the number to be divided before performing the division on it. Thus, we get statements that look like (a - (a % b)) / b And probably more parentheses surrounding it too, since it would be copy-pasted into yet another larger expression, because of course it would. `(a % b)` here is subtracting the remainder of `a` divided by `b`, using the modulo operator, before it gets divided by `b`. Thus, the number will always be divisible by `b`, so dividing it will mathematically not produce a decimal number. Needless to say, this is unnecessary, and very unreadable. In fact, when I saw these for the first time, I thought they were overcomplicated _modulos_, _not_ integer division! In C and C++, dividing an integer by an integer will always result in an integer, so there's no need to do all this runaround just to divide two integers. To find all of these, I used the command rg --pcre2 '(.+?).+?-.+?(?=\1).+?%.+?([\d]+?).+?\/.+?(?=\2)' which basically matches expressions of the form 'a - a % b / b', where 'a' and 'b' are identical and there could be any characters in the spaces. |
||
---|---|---|
.github | ||
desktop_version | ||
mobile_version | ||
third_party | ||
tools | ||
.gitattributes | ||
License exceptions.md | ||
LICENSE.md | ||
README.md |
This is the source code to VVVVVV, version 2.0+. For more context about this release, see the announcement on Terry's blog!
License
VVVVVV's source code is made available under a custom license. See LICENSE.md for more details.
In general, if you're interested in creating something that falls outside the license terms, get in touch with Terry and we'll talk about it!
Authors
- Created by Terry Cavanagh
- Room Names by Bennett Foddy
- Music by Magnus Pålsson
- Metal Soundtrack by FamilyJules
- 2.0 Update (C++ Port) by Simon Roth
- 2.2 Update (SDL2/PhysicsFS/Steamworks port) by Ethan Lee
- Beta Testing by Sam Kaplan and Pauli Kohberger
- Ending Picture by Pauli Kohberger
Versions
There are two versions of the VVVVVV source code available - the desktop version (based on the C++ port, and currently live on Steam), and the mobile version (based on a fork of the original flash source code, and currently live on iOS and Android).