Platform Builder Forums

Main => Suggestions => Topic started by: CGM on January 21, 2020, 07:48:20 PM

Title: New X&Y commands!
Post by: CGM on January 21, 2020, 07:48:20 PM
player 1 x+1 = enemy 12
What is this doing? It is moving the player 1 pixel closer to the enemy on the X position. This would be super cool for some things.
Title: Re: New X&Y commands!
Post by: CGM on January 21, 2020, 07:50:49 PM
Oh, and I really would like to see this in a patch, TingThing!
Title: Re: New X&Y commands!
Post by: saiwong3268 on January 21, 2020, 09:57:34 PM
player 1 x+1 = enemy 12
What is this doing? It is moving the player 1 pixel closer to the enemy on the X position. This would be super cool for some things.

Couldn't you use something like:

if player 1 x < [enemy 12 x]
{
player 1 x += 1
}
else
{
player 1 x -= 1
}
Title: Re: New X&Y commands!
Post by: CGM on January 21, 2020, 10:25:11 PM
You are BRILLIANT WARRIOR! I NEVER thought of that!
Title: Re: New X&Y commands!
Post by: Antikore on January 22, 2020, 07:11:16 AM
You are BRILLIANT WARRIOR! I NEVER thought of that!
It's something obvious

player 1 x+1 = enemy 12
What is this doing? It is moving the player 1 pixel closer to the enemy on the X position. This would be super cool for some things.
Cool idea but it's not the manner I think.
Title: Re: New X&Y commands!
Post by: CGM on January 22, 2020, 04:45:08 PM
Well, apparently I've been put in my place, I'd never thought of that!
Title: Re: New X&Y commands!
Post by: CGM on January 23, 2020, 10:52:29 PM
I've spent LOTS of time trying to get this idea to work for both X and Y coordinates. And it WILL NOT WORK. :/
Title: Re: New X&Y commands!
Post by: CGM on January 23, 2020, 10:55:11 PM
I really want this.
Title: Re: New X&Y commands!
Post by: saiwong3268 on January 23, 2020, 11:15:52 PM
I've spent LOTS of time trying to get this idea to work for both X and Y coordinates. And it WILL NOT WORK. :/

Can you be more specific as to what is not working ?
 I can get it working with the code I'd given you.

For both X and Y co-ordinates you can use something like

if player 1 x < [enemy 12 x]
{
player 1 x += 1
}
else
{
player 1 x -= 1
}



if player 1 y < [enemy 12 y]
{
player 1 y += 1
}
else
{
player 1 y -= 1
}