mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-22 17:49:43 +01:00
No description
4570140a6a
This commit fixes a bug that also sometimes occurred in 2.2, where the teleporter sprite would randomly turn into a solid color and just be a solid circle with no detail. Why did this happen? The short answer is an incorrect lower bound when clamping the teleporter sprite index in `Graphics::drawtele()`. The long answer is bad RNG with the teleporter animation code. This commit fixes the short answer, because I do not want to mess with the long answer. So, here is what would happen: the teleporter's `tile` would be 6. The teleporter code decrements its `framedelay` each frame. Then when it reached a `framedelay` of 0, it would call `fRandom()` and essentially ask for a random number between 0 and 6. If the RNG ended up being greater than or equal to 4, then it would set its `walkingframe` to -5. At the end of the routine, the teleporter's `drawframe` ends up being its `tile` plus its `walkingframe`. So having a `walkingframe` of -5 here is fine, because its `tile` is 6. Until it isn't. When its `tile` becomes 2, it still keeps its `walkingframe` around. The code that runs when its `tile` is 2 does have the possibility of completely resetting its `walkingframe` to be in bounds (in bounds after its `tile` is added), but that only runs when its `framedelay` is 0, and in the meantime it'll just use the previous `walkingframe`. So you could have a `walkingframe` of -5, plus a `tile` of 2, which produces a `drawframe` of -3. Then `Graphics::drawtele()` will clamp that to 0, which just means it'll draw the teleporter backing, and the teleporter backing is a simple solid color, so the teleporter will end up being completely and fully solid. To fix this, I just made `Graphics::drawtele()` clamp to 1 on the lower bound, instead of 0. So if it ever gets passed a negative teleporter index, it'll just draw the normal teleporter sprite instead, which is better. |
||
---|---|---|
.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).