supertux
supertux copied to clipboard
Incorporate certain object dynamics
For my 100th PR, I decided to fix some old issues I had involving the dynamics between some objects. Included in this PR are the following:
- Rocks no longer hurt Tux and bounce off of him, making rock puzzles more fair.
- Rocks now interact as expected with slick ice, water, bumpers, and trampolines.
- Enemies now interact as expected with water, bumpers, and trampolines.
- Objects oriented to the side (switches, darttraps, bumpers, stalactites, yeti stalactites, pushbuttons, ispys, and shards) now properly stick to moving objects which look like they can be stuck to (moving tilemaps, platforms, and fallblocks). [Fixes #1782]
Note: I was hoping to incorporate some more general method for point 4, where I didn't have to specify every single interaction and I could just label some objects as "sticky" and "sticked" objects, but this proved to be difficult as I don't think the game is currently capable of describing objects in such a way that I could do that, and I did not want to spend this PR refactoring some part of the game just to include that little thing. Each of the different possible interactions tends to have to some slight variation from one another, and there aren't very many of these possible interactions, anyway.
Not sure about the consistency of this behaviour. Also, the objects should probably only move with the tilemap/fallblock/... that's behind them to avoid situations like on the right side in the first video.
https://github.com/SuperTux/supertux/assets/14074789/420b416c-db53-4bac-9bea-fbb60cd80923
Also, this completely breaks this level (there are many more switches like this in it) and pretty much any level that has a lift controlled by a switch.
https://github.com/SuperTux/supertux/assets/14074789/986416ee-aead-4510-a5b2-d016a8c17690
Maybe objects should have the ability to be immovable
In my personal opinion, this idea is great. It would serve a lot in puzzle levels. An idea like that wouldn't be bad, you could make more creative levels with that idea
Also, this completely breaks this level (there are many more switches like this in it) and pretty much any level that has a lift controlled by a switch.
Not gonna lie this looks sick. I understand its technically broken but this would be a really cool thing to play around with.
Maybe objects should have the ability to be immovable
I agree, like an "immobile" option on the objects.
That is a lot of code duplication. Can this be done in other ways so we only have the same code once?
That is a lot of code duplication. Can this be done in other ways so we only have the same code once?
I tried to find ways around it, but it appears the way each object is handled is done differently in such a way that at least I couldn't personally get it to work.
How about moving this to a parent ~~GameObject~~ BadGuy class method?
Are stalactites/yeti stalactites also sticky objects? And if not can they be?
How about moving this to a parent ~GameObject~ BadGuy class method?
Now I am probably going to refactor the PR with this is mind.
I haven't checked this one in a while but I was thinking it would be a fun idea for the Vicious Ivy and Walking Leaf enemy to float on water rather than sink.
Feel we should allow tux to pick up items whilst crawling, ended up getting myself trapped whilst testing a level
Feel we should allow tux to pick up items whilst crawling, ended up getting myself trapped whilst testing a level
I'd consider this more relevant to another PR. I think this PR has all the additions I'm willing to make in it for now. You can make an issue for it you want so I can keep track of it, or I can make the issue myself.
I didn't mean to approve this. I meant to only comment on it without explicit approval
Feel we should allow tux to pick up items whilst crawling, ended up getting myself trapped whilst testing a level