I Wanna Community

Fangames => Game Design => Programming Questions => Topic started by: Keykay on January 12, 2015, 07:47:46 PM

Title: Help with secret items
Post by: Keykay on January 12, 2015, 07:47:46 PM
Well I know how to make secret items, but does anyone know how I can make the spikes and savepoints disappear if you collect the item like in Kamilia 3? I only know how to make them disappear immediately, in Kamilia 3 they disappear slowly and that looks so cool D: Would be nice, if anyone could help me^^
Title: Re: Help with secret items
Post by: YoSniper on January 12, 2015, 08:44:39 PM
Maybe do something like this with the object that acts as the parent for spikes and fruit and such...

(As long as it doesn't overwrite an event of any sort.)

Code: [Select]
Secret Item collision with Player:

with(spike_fruit_parent) {alarm[0] = 2;}
instance_destroy();

The exact object names are probably different or need to be created.

Code: [Select]
Alarm[0] Event of spike_fruit_parent:

image_alpha -= 0.05;
if image_alpha <= 0 {instance_destroy();}
else {alarm[0] = 2;}

Something like that? You might have to tweak the timing a bit.
Title: Re: Help with secret items
Post by: Keykay on January 12, 2015, 09:26:11 PM
Maybe do something like this with the object that acts as the parent for spikes and fruit and such...

(As long as it doesn't overwrite an event of any sort.)

Code: [Select]
Secret Item collision with Player:

with(spike_fruit_parent) {alarm[0] = 2;}
instance_destroy();

The exact object names are probably different or need to be created.

Code: [Select]
Alarm[0] Event of spike_fruit_parent:

image_alpha -= 0.05;
if image_alpha <= 0 {instance_destroy();}
else {alarm[0] = 2;}

Something like that? You might have to tweak the timing a bit.

Wow, it worked! Thanks for your help, I really appreciate it :)
Title: Re: Help with secret items
Post by: Keykay on January 12, 2015, 09:50:06 PM
Maybe do something like this with the object that acts as the parent for spikes and fruit and such...

(As long as it doesn't overwrite an event of any sort.)

Code: [Select]
Secret Item collision with Player:

with(spike_fruit_parent) {alarm[0] = 2;}
instance_destroy();

The exact object names are probably different or need to be created.

Code: [Select]
Alarm[0] Event of spike_fruit_parent:

image_alpha -= 0.05;
if image_alpha <= 0 {instance_destroy();}
else {alarm[0] = 2;}

Something like that? You might have to tweak the timing a bit.

do you also know how this works when I want to let something appear after collecting the item, like a warp? :/
Title: Re: Help with secret items
Post by: YoSniper on January 13, 2015, 04:36:23 PM
do you also know how this works when I want to let something appear after collecting the item, like a warp? :/
You can put something like this in the Destroy Event for the secret item:
Code: [Select]
instance_create(?, ?, obj_warp);
REMEMBER TO REPLACE THE QUESTION MARKS WITH ACTUAL VALUES!

I can't tell you the number of times I've given pseudo-code to people, and they just blindly copy and paste it, and then come back to me with "I got an error, unknown value '?'."