mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-22 17:49:43 +01:00
No description
88d49547d4
This fixes a regression where the behavior of duplicate player entities is different, causing a gameplay section in Vespera Scientifica to be impossible, as described in #903. In the level, you are allowed to flip in mid-air. Vespera accomplishes this by having two duplicate player entities stuck in a platform. One of them is responsible for letting the player flip in one direction, and one of them is responsible for letting them flip in the other. In 2.3, this works because in order for a player entity to flip, `game.jumppressed` is checked, and the entity will flip if `game.jumppressed` is greater than 0, then `game.jumppressed` will be set to 0. In this way, whenever a player entity flips, it will set `game.jumppressed` to 0, so whenever the next player entity is evaluated, `game.jumppressed` is 0 and thus _that_ entity will not flip. This is because the for-loop surrounds both the `game.jumppressed` check and flipping the entity. In 2.4 after #609 and subsequent patches, however, this is not the case. Here, the for-loop only surrounds flipping the entity. Therefore, the `game.jumppressed` check is evaluated only once. So, it will end up flipping every player entity if the entities are eligible. In this case, one of them is eligible twice, resulting in the game flipping gravitycontrol four times, which is essentially the same as not flipping at all (except for all the sound effects). Hence, the fix here is to make it so the for-loop surrounds the `game.jumppressed` check. Now, this doesn't mean that the intent of #609 - that duplicate player entities have the same initial velocity applied to them when flipping - has to be removed. We can just put the for-loops back in. But I carefully implemented them in such a way that the overall function is not quadratic, i.e. O(n²). Instead, there's a pass done over the `obj.entities` vector beforehand to store all indexes of a player entity in a temporary vector, and then that vector is used to update all the player entities. In this manner, the function is still linear - O(n) - over the number of entities in the room. I tested this to make sure that no previous regressions popped up again, including #839, #855, and #887. And #484 is still resolved. Fixes #903. |
||
---|---|---|
.github | ||
desktop_version | ||
mobile_version | ||
third_party | ||
tools | ||
.gitattributes | ||
.gitmodules | ||
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).