• Hey! Guest! The 39th GMC Jam will take place between November 26th, 12:00 UTC and November 30th, 12:00 UTC. Why not join in! Click here to find out more!

i need help on this...

L

lDashunl

Guest
So i been doing good so far with my platform game and programming it with help from few you tube videos but i need help from a experience programmer cause i got problem with this ability my player have. So here's his ability, he can shoot a ball called teleBall that move towards the mouse but can only go so far till it drop from the gravity and when it land on a object or plat form after it lands the x and y coordinate of the ball is where my player teleportsto (its gonna be sorta like a stealth game) and here's the code i use in the object of the ball and with the collision event of all the wall and platforms in the game for the teleporting:

Code:
//Floor Collision
move_contact_solid(direction,12)vspeed=0
//Teleporting
if instance_exists(obj_teleBall)
{
    obj_player.x = obj_teleBall.x
    obj_player.y = obj_teleBall.y
}
Now here's the problem the code works and everything, my player actually teleport to the ball but after the player teleport the ball is still there and the player can't move and i tried shooting another teleBall to see if i could teleport to another ball but it seem once i teleport the first time the code stop working afterwards so here's where i need help since i know almost nothing of programming or gml, so is there a code where when my player is overlapping the teleBall, it delete the ball every time after the player teleport to it like some collision checking or some sort and if u can help please paste the code with your responds and if u can give me steps like what event to put it in or what object etc
 
2

2Create

Guest
when the player has teleported, run the code "instance_destroy();" for the teleBall.
 
L

lDashunl

Guest
can u give me a example of code cause i think its more to it for what i'm trying to accomplish, i want it to detect when the player and ball is colliding(one on top of each other) like a if statement in a step event for example
 
2

2Create

Guest
in the TeleBall (step event, most likely):

Code:
if place_meeting(x, y, obj_player)
{
    instance_destroy();
}
 
What RangerX means is that if you have no further questions to solve - edit the title (should be a button top right that says 'edit title') and put [solved] at the beginning. Then people know they don't need to respond anymore :)
 
true - but the OP posted 12 minutes ago, so they've seen it since then. I just posted that in case they didn't know what to do.
No they didn't. In fact, they haven't even logged in since then. It's just someone else having a breakdown and bumping a bunch of threads from the forum rebirth.
 
Top