Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the RubLight object #1416

Merged
merged 6 commits into from
Jun 12, 2020
Merged

Add the RubLight object #1416

merged 6 commits into from
Jun 12, 2020

Conversation

HybridDog
Copy link
Contributor

It glows when it is rubbed, e.g. when Tux or a badguy walks on it.
Skidding makes it glow bright.

I think this object could be used to fix the dark crystal mine issue #1317.
fot_2020-06-03-20:05:27_545027911

I have never added a new object to SuperTux, so please tell me if I did something wrong.

It has not much to do with that Rublight. I've given it this name because Triboluminescence literally means rublight and Triboluminescence is probably more complicated and realistic than what I have implemented.

src/badguy/walking_badguy.hpp Outdated Show resolved Hide resolved
src/object/rublight.cpp Outdated Show resolved Hide resolved
@weluvgoatz
Copy link
Member

Is the color of the light here configurable? If not, it would be nice to have.

@HybridDog
Copy link
Contributor Author

HybridDog commented Jun 4, 2020

Is the color of the light here configurable? If not, it would be nice to have.

I've made the color and fading speed configurable.
The default value of the fading_speed appears now in three places: the constructor, in the mapping.get invocation and in the get_settings method. I've looked at the spotlight code for how to do it and I don't know if the default value is required at all three places.

Edit: get_settings is used by the editor and mapping.get has an optional default value parameter.

@tobbi
Copy link
Member

tobbi commented Jun 5, 2020

One small thing from Travis:

/rublight.cpp.o -c /Users/travis/build/SuperTux/supertux/src/object/rublight.cpp

/Users/travis/build/SuperTux/supertux/src/object/rublight.cpp:34:3: error: field 'fading_speed' will be initialized after field 'light' [-Werror,-Wreorder]

  fading_speed(5.0f),

  ^

1 error generated.

@HybridDog
Copy link
Contributor Author

One small thing from Travis:

it should be fixed now

@tobbi tobbi merged commit 8cc1afe into SuperTux:master Jun 12, 2020
@HybridDog HybridDog deleted the m_rublight branch June 12, 2020 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants