IGNORED

# Way to make vertical and horizontal player move same?

## Recommended Posts

player0y=player0y-1 or +1

player0x=player0x-1 or +1

When moving horizontally it appears you move a tiny bit faster.

I assume due to resolution.. is there a way around this?

##### Share on other sites

If I want a simple slow down I sometimes just alternate frames the horizontal movement moves on.

like if w{0} then skip horizontal movement.

otherwise I’d use another variable and dim playerx =playerx.a or something like that. Can’t remember all the details or if I’m missing something as I'm away from my keyboard

##### Share on other sites

I can't help but wonder where it would matter.

The simplest way I can think of is make one of player0x or player0y an 8.8 variable so you can move in fractional pixels

So eg if 3 * y = 4 * x

dim p0y = player0y.y

player0x = player0x + 1 : p0y = p0y + 0.75

##### Share on other sites

5 hours ago, bogax said:

I can't help but wonder where it would matter.

The simplest way I can think of is make one of player0x or player0y an 8.8 variable so you can move in fractional pixels

So eg if 3 * y = 4 * x

dim p0y = player0y.y

player0x = player0x + 1 : p0y = p0y + 0.75

I didn't know I can do + 0.75.. I had tried to do something like that before but it didn't work. Will try again.

##### Share on other sites

10 hours ago, Words Fail said:

I didn't know I can do + 0.75.. I had tried to do something like that before but it didn't work. Will try again.

Check out this program:

##### Share on other sites

On 12/26/2022 at 11:18 AM, bogax said:

I can't help but wonder where it would matter.

The simplest way I can think of is make one of player0x or player0y an 8.8 variable so you can move in fractional pixels

So eg if 3 * y = 4 * x

dim p0y = player0y.y

player0x = player0x + 1 : p0y = p0y + 0.75

I appreciate it. That works great.

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.