Interaction type: Difference between revisions

Jump to navigation Jump to search
Text, Koopa, Pole, and Cap
(Bounce top)
(Text, Koopa, Pole, and Cap)
Line 84: Line 84:
This interaction is used for collecting coins, as the name implies. When the interaction occurs, the number of coins Mario has is increased by the value of the coin, his heal counter is increased by 4 times the value of the coin, and the coin’s interaction status is updated to mark that an interaction has occurred. If the course is a main course, the number of coins Mario has minus the value of the coin is less than 100, and Mario has at least 100 coins, the 100 coin star spawns.
This interaction is used for collecting coins, as the name implies. When the interaction occurs, the number of coins Mario has is increased by the value of the coin, his heal counter is increased by 4 times the value of the coin, and the coin’s interaction status is updated to mark that an interaction has occurred. If the course is a main course, the number of coins Mario has minus the value of the coin is less than 100, and Mario has at least 100 coins, the 100 coin star spawns.
===Cap===
===Cap===
This interaction is used for when Mario picks up caps. When the interaction occurs, the game gets Mario’s current cap status, and initializes two variables for the cap timer and cap music. If Mario is not currently being blown away and Mario is wearing some kind of cap already, the game sets Mario’s interactObj flag to the object and sets the object’s interaction attribute to reflect that it has been interacted with. If the object is a Vanish Cap, the cap’s timer is set to 600 and the music is set to the Wing Cap music. If the cap is a Metal Cap, the cap’s timer is set to 600 and the music is set to the Metal Cap music. If the cap is a Wing Cap, the cap’s tiomer is set to 1800 and the music is set to the Wing Cap music. If the cap timer from the cap just collected is greater than Mario’s current cap timer, Mario’s cap timer is set to the collected object’s cap timer. If Mario is idling or Mario is walking, Mario puts the cap on. Otherwise, Mario’s flags are updated to have a cap on his head directly. Then, two sounds play and if the cap music is not set to 0, the cap music plays.
===Pole===
===Pole===
This interaction is used for things Mario can climb i.e. poles. When the interaction occurs, the game gets Mario’s action and checks if it is a suitable action for pole climbing. If it is, the game checks if Mario is not already on a pole or if Mario’s usedObj attribute is not set to the object he is interacting with. If the condition is met, the game sets a variable that tells whether or not Mario’s forward speed is below 10, makes Mario stop riding or holding any object, set’s Mario’s interactObj and usedObj attributes to the object, sets Mario’s forward and vertical velocities to 0, and sets several attributes regarding Mario and the pole. If Mario’s speed is below 10, Mario grabs the pole slowly. Otherwise, Mario’s pole yaw velocity is set to his forward velocity times 1.4 degrees plus 22.5 degrees, his pitch is reset, and his action is set to grabbing the pole quickly.
===Koopa===
===Koopa===
Same as Bounce Top.
===Spiny===
===Spiny===
===Breakable Block===
===Breakable Block===
Line 106: Line 109:
===Bounce Top/Bottom===
===Bounce Top/Bottom===
===Text===
===Text===
This interaction is used for objects that display text when Mario interacts with them. When the interaction occurs, the game determines which interaction subtype it is. If the interaction has the sign subtype, the game returns a function for Mario to read the sign. If the interaction subtype is the NPC subtype, the game returns a function for Mario to talk to the NPC. Otherwise, the game pushes Mario 2 units away from the object.
===Tornado===
===Tornado===
This interaction is used for the tornadoes in Shifting Sand Land. When the interaction occurs, the game checks to see if Mario is in the tornado twirling action or is squished. If Mario is not in either of this states, Mario stops riding anything or holding anything if he is doing either of those things, his forward velocity is set to 0, a sound effect plays and Mario’s action is set to the tornado twirling action.
This interaction is used for the tornadoes in Shifting Sand Land. When the interaction occurs, the game checks to see if Mario is in the tornado twirling action or is squished. If Mario is not in either of this states, Mario stops riding anything or holding anything if he is doing either of those things, his forward velocity is set to 0, a sound effect plays and Mario’s action is set to the tornado twirling action.

Navigation menu