Author Topic: New X&Y commands!  (Read 1445 times)

CGM

  • Christian, 3D artist, former Platform Builder gamdev
  • Master Builder
  • *
  • Posts: 3836
    • View Profile
New X&Y commands!
« 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.

CGM

  • Christian, 3D artist, former Platform Builder gamdev
  • Master Builder
  • *
  • Posts: 3836
    • View Profile
Re: New X&Y commands!
« Reply #1 on: January 21, 2020, 07:50:49 PM »
Oh, and I really would like to see this in a patch, TingThing!

saiwong3268

  • Level 6: Milder
  • *
  • Posts: 119
    • View Profile
Re: New X&Y commands!
« Reply #2 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
}

CGM

  • Christian, 3D artist, former Platform Builder gamdev
  • Master Builder
  • *
  • Posts: 3836
    • View Profile
Re: New X&Y commands!
« Reply #3 on: January 21, 2020, 10:25:11 PM »
You are BRILLIANT WARRIOR! I NEVER thought of that!

Antikore

  • Developing Mortal Theater at day, developing depression at night.
  • Level 22: Trex
  • *
  • Posts: 2020
  • Enjoying Platform Builder from the very start
    • View Profile
    • PBuilder Resources
Re: New X&Y commands!
« Reply #4 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.
Sorry because my English is not very good because I'm Spanish ;) :P

CGM

  • Christian, 3D artist, former Platform Builder gamdev
  • Master Builder
  • *
  • Posts: 3836
    • View Profile
Re: New X&Y commands!
« Reply #5 on: January 22, 2020, 04:45:08 PM »
Well, apparently I've been put in my place, I'd never thought of that!

CGM

  • Christian, 3D artist, former Platform Builder gamdev
  • Master Builder
  • *
  • Posts: 3836
    • View Profile
Re: New X&Y commands!
« Reply #6 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. :/

CGM

  • Christian, 3D artist, former Platform Builder gamdev
  • Master Builder
  • *
  • Posts: 3836
    • View Profile
Re: New X&Y commands!
« Reply #7 on: January 23, 2020, 10:55:11 PM »
I really want this.

saiwong3268

  • Level 6: Milder
  • *
  • Posts: 119
    • View Profile
Re: New X&Y commands!
« Reply #8 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
}