Pixel Game Maker MV

Pixel Game Maker MV

评价数不足
How to Deal with Damage and Invincibility by Kohei Gallery (Shooting Chicken)
由 PixCube 制作
English Version of the Japanese guide available on: https://tkool.jp/act/tsukler/02_01.html
   
奖励
收藏
已收藏
取消收藏
About Detection Settings
Collision Detection

To enable damage detection, you need to adjust the Collision Detection settings on the animation tab. There are several types of collision detection; you can set the Collision Detection for the side taking damage, as well as the Attack Detection for the side dealing damage. Select the frame you want to add the detection to on the timeline at the bottom of the screen and set the range and location of the Collision Detection.



Object Settings


Next, adjust the settings for objects.
Right click on the object and choose Object Settings from the menu. Select the Object Group this object belongs to. Be sure to Allow Attack Detection Hits for any object groups that deal damage to the object. If the objects are the player character and an enemy, then both objects must be selected.
About Attack Settings
Attack Settings



As most of the attacks in Shooting Chicken are done with firearms, Collision Detection must be set for bullets. First, set the motion under the Detection settings on the animation tab, and add the Attack Settings to the Other Runtime Actions. In the Basic Attack Settings, you can set what effect the Attack Detection will have. Separate from the object settings, here the object group can also be adjusted, but as this will make working on the game more complicated, this method is not recommended. Set Attribute can be used to attribute values to the attack. In the Action notes you can see the attributes used in Shooting Chicken.
* These are not the actual attribute effects. They are the attack IDs, which determine the action-side's effect based on this ID.

Collision Detection Settings


Before adjusting Collision Detection settings, you must set the object's HP in the Basic Settings. HP and attack power are the same as in any game. The damage rate is the rate of damage reduction against attacks; let's set it at 100%.
Under Temporary Invincibility After Receiving Damage, it's possible to set the time the character will be invincible for after taking damage. This is an important setting as it prevents your characters from constantly taking damage when coming into contact with any items with an Attack Detection box.

Common Actions



Here you can add a damage detection to Common actions to make it possible for damage to be taken from any action. If you want to limit the actions that deal damage, it's better to use normal actions rather than common actions.
Add the Attack Detection to the link conditions in the advanced settings.
Select the group attributed to this object's collision detection. As bullets belong to the Effect group, here "Effect" should be selected.

Set the details for Common Actions



As this is an action following taking damage, set motion as Damage.
Now this will be activated when you come in contact with the Attack Detection. You can also set other executable actions such as reactions to damage taken and flags such as switches and other variables. This is mainly where sound effects played or damage variables displayed are set.




About Invincibility
Managing Invincibility and Multiple Damage



Strong enemies such as a boss character will require the setting of multiple attacks.
From here, we will explain how to create a process that allows for multiple attacks.

Set Detection for Various Attacks




In Shooting Chicken, the various attacks are divided into 4 types:
Normal attacks, Explosions, Fire, and Ignition.
Each attack has dedicated objects that respond to them, and are associated with a Parent Enemy Object.




Set groups in the Object Settings for different objects' Attack yypes. Here, the Attack Detection for explosions is set. To make the Attack Detection box effective on contact, damage detection must be linked to the action. Add Attack Detection to the link conditions, and set the Effect and attribute attack ID variables for the object group.

* Don't forget to make sure the various Attack Detection objects have the same basic settings as their parent object.



We added the actual HP variable for the Parent object, but since other variables are already set for easy control, this can also be the Parent Object's HP.

Next, set the action to be performed when damage is enabled on each type of object's hitbox. Add switches and variable changes, and select the actual HP variable attributed to the parent object. Assign to the actual HP calculations and select the damage taken variable for the object. With this, when the object's hitbox detects damage has been taken, the effect will be counted towards all the objects just the same as the parent object's actual HP.