MFGG Forums
How To Do DKC Banana Fly To HUD Effect? - Printable Version

+- MFGG Forums (https://forums.mfgg.net)
+-- Forum: MFGG (https://forums.mfgg.net/forumdisplay.php?fid=4)
+--- Forum: Developer Discussion (https://forums.mfgg.net/forumdisplay.php?fid=10)
+--- Thread: How To Do DKC Banana Fly To HUD Effect? (/showthread.php?tid=954)



How To Do DKC Banana Fly To HUD Effect? - Yoshi2000 - 05-26-2018

I've been wanting to know for quite some time on how to do the DKC "Banana Flying To HUD" Effect in GM 8.0 for some time now. If you've never played DKC then let me tell you what's like: Basically, when you collect a Banana it'll fly up into the Banana Counter then disappear. I want to know how to replicate this effect in GM 8.0 as there are no tutorials on how to make a DKC fangame tutorial, (I would watch a video on how to make the effect), but there is none. Thank you for helping a guy out!


RE: How To Do DKC Banana Fly To HUD Effect? - Syaxamaphone - 05-26-2018

What I think would be the easiest would be having the banana create a seperate bananaCollected object (or whatever you want to call it) and then having that object do the following code in its step event:

Code:
direction = point_direction(x,y,HUDX,HUDY);
speed = 6; //this can be whatever

if point_distance(x,y,HUDX,HUDY) < 6 {
   bananas+=1;
   instance_destroy();
}

Obviously you'll need to change some variable names depending on what your variables are actually called (I don't know how you're storing banana count for example), but this should work.

The basic process would be to have the banana you collect change into the banana collected on collision with your kong, then have this object work its magic.

HUDX and HUDY could probably just be view_xview and view_yview if you're keeping bananas on the top left of the screen.


RE: How To Do DKC Banana Fly To HUD Effect? - Mariotroid - 05-26-2018

https://youtu.be/3l4YivV3uDc

^^I tried Syaxamaphones method in one of my games. This is how it looks. (With coins instead of bananas)


RE: How To Do DKC Banana Fly To HUD Effect? - Yoshi2000 - 05-27-2018

(05-26-2018, 09:16 PM)Syaxamaphone Wrote: What I think would be the easiest would be having the banana create a seperate bananaCollected object (or whatever you want to call it) and then having that object do the following code in its step event:

Code:
direction = point_direction(x,y,HUDX,HUDY);
speed = 6; //this can be whatever

if point_distance(x,y,HUDX,HUDY) < 6 {
   bananas+=1;
   instance_destroy();
}

Obviously you'll need to change some variable names depending on what your variables are actually called (I don't know how you're storing banana count for example), but this should work.

The basic process would be to have the banana you collect change into the banana collected on collision with your kong, then have this object work its magic.

HUDX and HUDY could probably just be view_xview and view_yview if you're keeping bananas on the top left of the screen.
That doesn't work, the banana goes into the air nor does it get destroyed by it and doesn't go to the object. Here is my code:
Code:
direction = point_direction(x,y,obj_counter,obj_counter);
speed = 6; //this can be whatever

if point_distance(x,y,obj_counter,obj_counter) < 6 {
  instance_destroy();
}
EDIT: I got it working! I just put .x and .y on the end of the object names.


RE: How To Do DKC Banana Fly To HUD Effect? - Syaxamaphone - 05-27-2018

Nice, I'm glad you got it figured out!

Good to see more people taking an interest in the DKC games. Need more fan games of those.


RE: How To Do DKC Banana Fly To HUD Effect? - Yoshi2000 - 05-27-2018

(05-27-2018, 02:28 PM)Syaxamaphone Wrote: Nice, I'm glad you got it figured out!

Good to see more people taking an interest in the DKC games. Need more fan games of those.
Actually I was using it for this:
https://forums.mfgg.net/showthread.php?tid=75&pid=11478#pid11478 Wink