Game
Rocket Shipment

5 years ago

Options, options, options


I'm booking nice progress with the options menu.

I have made a reusable dropdown component that supports scrolling though buttons and the mouse wheel.

At first I wanted the text to smoothly scroll in and out of view by partially rendering the text when it's partly outside view, but unfortunately SFML does not really have a good option for that.

I could convert the text to a texture and then partially render it through a sprite, but this just seems like too much effort for a very small detail. I chose to scroll text completely in or completely out, avoiding this situation all together.

My first scroll attempt was pretty hilarious.

faulty_scrolling.gif

But a few adjustments later, scrolling was working like a charm.

scrolling.gif

Technically the dropdown component reuses my TextInput component used in the save menu (to enter the save file name) and als reuses the SelectionTable component I made for the tile editor.

The TextInput is used for the top part of the dropdown that will show the surrently selected value. The SelectionTable is used for the scrollable options part that also highlights the currently selected option.

The SelectionTable already had the selection colouring implemented. I simply expanded the class to support scroll buttons as well, and voila, a working dropdown!

selection.gif

Thinking about the settings I should add, the amount of work seemed to continuously increase.

I want to implement settings for resolution, language, controls, fullscreen/windowed mode, brightness, and of course music and sound. The language setting is easily implemented because I already finished the base localization code.

The other settings need some more investigation. SFML seems to be able to handle the difficult parts regarding the resolution and fullscreen/windowed settings, which is nice.

The controls however are currently hard coded, so I will have to create some mapping in between for those settings. The brightness setting will introduce me to the world of shaders. I will make a shader that brightens or darkens the whole screen based on this setting. It will be my first shader ever, which is exiting, but also daunting.

I've honestly never worked with shaders, let alone wrote them. They always sounded like this hugely complex magical thing that only wizards could conjure.

All in all, coding these settings is a big task. But I'll probably gloat in pride when it's done!



2 comments

Loading...

Next up

Update v0.5.0 featuring new conveyor tiles

Update v0.7.0: Lowering difficulty

Update v0.8.0: Introducing powerups

I used my meager gamedev earnings to fund a new trailer. What do you think?

Devlog #073: Configurable gate speeds

Releasing my game after more than 2 years of development

Update v0.6.0: Improving player experience

Release date has been set!

Rocket Shipment CHANGELOG v0.9.0

Rocket Shipment CHANGELOG v0.10.0 - Introducing new crates!