Author Topic: Help with secret items  (Read 1784 times)

Keykay

  • Trial Wannabe
  • Posts: 3
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 36.0.1985.125 Chrome 36.0.1985.125
    • View Profile
  • Playstyle: Keyboard
Help with secret items
« 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^^

YoSniper

  • Awexome
  • Global Moderator
  • Spike Dodger
  • Posts: 142
  • People regard me as a programming overlord.
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 39.0.2171.95 Chrome 39.0.2171.95
    • View Profile
    • My YouTube
  • Playstyle: Keyboard
Re: Help with secret items
« Reply #1 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.
I don't traverse the forums as much anymore. Follow me on Twitter if you want to keep tabs on me!

Twitter: @YoSniperGames
Twitch: yosniper

Streams happen whenever I feel like it.

Keykay

  • Trial Wannabe
  • Posts: 3
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 36.0.1985.125 Chrome 36.0.1985.125
    • View Profile
  • Playstyle: Keyboard
Re: Help with secret items
« Reply #2 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 :)

Keykay

  • Trial Wannabe
  • Posts: 3
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 36.0.1985.125 Chrome 36.0.1985.125
    • View Profile
  • Playstyle: Keyboard
Re: Help with secret items
« Reply #3 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? :/

YoSniper

  • Awexome
  • Global Moderator
  • Spike Dodger
  • Posts: 142
  • People regard me as a programming overlord.
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 39.0.2171.95 Chrome 39.0.2171.95
    • View Profile
    • My YouTube
  • Playstyle: Keyboard
Re: Help with secret items
« Reply #4 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 '?'."
I don't traverse the forums as much anymore. Follow me on Twitter if you want to keep tabs on me!

Twitter: @YoSniperGames
Twitch: yosniper

Streams happen whenever I feel like it.