BearBearBear Dev Diary – #1

I started working on the programming for BearBearBear (BBB). I’ve decided to use C++ and Unreal Engine for this project as I want to improve my C++. The main challenge I was tackling today was trying to figure out how to get reels in a slot machine to work. My solution was to use a timeline that would spin the reels to the randomly generated outcomes.

I have worked with timelines in Blueprints before but never with C++ so my first challenge was to figure that out. I watched this video through to get an understanding of the workings of timelines in C++. This allowed me to set up my own timeline and set up a subroutine that is called every tick of the timeline. I struggled to find how to get access to the on finished event for the timeline so to work around this I created an if statement in the update subroutine that checks if the timeline has reached the end.

Now that I have my timeline set up and ready to use I need to work on everything around the timeline. That includes keeping track of which side of the wheel is currently showing, calculating the rotations needed to land on the randomly generated result & much more.

Bibliography

Dev Enabled. (2019, August 25). C++ Timeline Float Animation UE4 / Unreal Engine 4 C++. YouTube. https://www.youtube.com/watch?v=1y-FnncH-XQ