supertux icon indicating copy to clipboard operation
supertux copied to clipboard

Incorporate certain object dynamics

Open weluvgoatz opened this issue 1 year ago • 10 comments

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.

weluvgoatz avatar Mar 25 '24 05:03 weluvgoatz

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

Narre avatar Mar 25 '24 11:03 Narre

Maybe objects should have the ability to be immovable

bruhmoent avatar Mar 25 '24 11:03 bruhmoent

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

VincentAraneo avatar Mar 25 '24 15:03 VincentAraneo

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.

tylerandari13 avatar Mar 25 '24 15:03 tylerandari13

That is a lot of code duplication. Can this be done in other ways so we only have the same code once?

tobbi avatar Apr 13 '24 14:04 tobbi

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.

weluvgoatz avatar Apr 14 '24 21:04 weluvgoatz

How about moving this to a parent ~~GameObject~~ BadGuy class method?

tobbi avatar Apr 14 '24 21:04 tobbi

Are stalactites/yeti stalactites also sticky objects? And if not can they be?

tylerandari13 avatar Apr 16 '24 22:04 tylerandari13

How about moving this to a parent ~GameObject~ BadGuy class method?

Now I am probably going to refactor the PR with this is mind.

weluvgoatz avatar Apr 20 '24 15:04 weluvgoatz

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.

Rusty-Box avatar May 19 '24 18:05 Rusty-Box

trappedforeternity Feel we should allow tux to pick up items whilst crawling, ended up getting myself trapped whilst testing a level

Sevenberry avatar Jun 18 '24 19:06 Sevenberry

trappedforeternity 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.

weluvgoatz avatar Jun 18 '24 20:06 weluvgoatz

I didn't mean to approve this. I meant to only comment on it without explicit approval

MatusGuy avatar Jun 22 '24 14:06 MatusGuy