Mario Kart Item Post 6

Overview

Data driving items and bullet bills.

Item Data Driving

Since now all of the item variables’ values have been stored in their respective class. However, this made the item system very rigid and the values of the variable needed to be read in from JSON files to be more data-driven. There was already an item config JSON file that stored the probabilities of getting each item from an item box depending on your rank. This was then added to the variables and their values of the items. To help contain this data in the item class’ structs were set up that stored types of data used by multiple items, such as boost data for mushrooms and stars and growth data for giant mushroom and lightning clouds. It was also made possible for any item that can collide with the player to use all 3 forms of animation (jump, flip, and spin) with the animations not being used value’s being set to 0. The new additions to the item config files are currently being added to the code base’s asset manager so the values can be changed there.

Bullet Bill

With the Ai made by another group member being now available the bullet bill item can be implemented. This item causes the player to turn into a large bullet which auto steers the player, makes them invincible and gives them a speed boost. Its duration lasts longer the further back the player is in the player rankings.

When the bullet bill is used it switches the player’s model to the bullet bill (this was implemented by another group member). The duration of the item is then set to equal the player’s ranking so if they’re in 12th then the bullet bill lasts for 12 seconds. Then it checks the player’s id to see if it is -1. If it is then the player is an ai player, if not then it is a regular player and the ai controller is added to the using player class. The player’s current move and turn speeds are then stored in the bullet bill class. The player’s move and turn speed are then increased to give the player the speed boost. During the update function when the bullet is used the player’s movement class is updated which allows the ai to control it and the duration of the bullet counts down. Once the duration is completed the players move and turn speed and reset back to the stored values and if the player is not an ai then the ai in the player class is removed. The bullet bills variables were also added to the item config JSON file and read in when the bullet is constructed.

Previous
Previous

Mario Kart Item Post 7

Next
Next

Mario Kart Item Post 5