Post 139
Cant Pickup Potions?
This class I will be attempting to create an animation for picking up health pots. My first biggest struggle was trying to find the code that allows the player to pickup health pots, and I probably spent around 30 minutes looking through every line of script inside the player object and inside the player script pages. Sadly after all this I remembered that I put the code within the actual health potion object.
if (place_meeting(x,y,obj_player)) and obj_player.healthpots < 3
{
image_index = 1;
if keyboard_check(ord(obj_player.button_activate))
{
sprite_index = spr_player_1_drinking
busy = true;
if image_index > -0
{
busy = false;
}
audio_play_sound(sou_potion_pickup,1,false)
obj_player.healthpots += 1;
instance_destroy();
}
}
The red text is the added code to the game. So at the time of writing this I am unsure if this will work properly. So I guess I will find out in a minute.
And as you can see, this did not work in the slightest way. Not even a strange glitched version of what I wanted. And thanks to never finding where the code actually was until this late, I don't have time to fix my mistakes, so I will just have to do that next class.
No comments:
Post a Comment