In these lines of code we have created FUNCTION and name it "Loot_Drop". This function will be called soon as enemy dies meaning Enemy_Health = less than 0 (Zero). Next we are saying C2 to wait about 0.02 seconds and then destroy spr_Enemy, spr_Healthbar.
Next lines is easy all we doing is when spr_Enemy, spr_Healthbar destroyed spawn ITEM for player to Pickup. Note we have 2 thing that will be drop by Enemy Death HEALTH and KNIFE. So I have made choose 1 or 2 which ever ITEM can be dropped. Also note when Enemy drop Item we have to make sure it will drops at bottom so we say move to bottom of layer.
Now go back to your Player events and add this line below:
Here we are instructing C2 to check if our player is overlapping spr_Items if he or she is then add spr_Items to our Inventory;
If Item ID_1 = 1 then healing_Potions
If Item ID_2 = 2 then randomly add num_Ammo 10,20,15,10 that is up to you.
Before we go any further we have to adjust or sword for player. Just add line below in your player sword attacks.
Now if you RUN it will work fine but, when you try to use POTIONS it will not be updated. So we have to do that now.
All we have to do is go back to our Player event and add this lines below:
Well our RPG is finish. Your task is improving on it and makes games the way you feel best. Please at least leave behind some comments. I do not ask for money or anything just thanks are fine. This will give me enthusiasm and devotion to write more tutorials to help you. If any mistakes please let me know. Thanks
Bless you all