Jump to content
IGNORED

Way to make vertical and horizontal player move same?


Words Fail

Recommended Posts

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 

  • Like 1
Link to comment
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.

Link to comment
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:

 

https://www.randomterrain.com/atari-2600-memories-batari-basic-commands.html#ex_8_8_speed_change

  • Like 3
Link to comment
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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...