(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: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,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.
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();
}