Pixel Movement

by Forum_account
Pixel Movement
A pixel movement library for isometric and top-down maps.
ID:803963
 
I am using Pixel Movement, Is it possible to move diognal using only 4 Dirs so it dosnt keep its default icon_state like

if usr is walking to left and bump into densed turf, then user holds left and presses north (to move Diognal NorthEast) the iconstate changes to North or what ever it is on 8 dirs icon
You can do something like this:

mob
movement()
..()

if(move_y > 0)
dir = NORTH
else if(move_y < 0)
dir = SOUTH
else if(move_x < 0)
dir = WEST
else if(move_x > 0)
dir = EAST
In response to Forum_account
but i want it to work something like this
if(src.MN || src.QueN)
if(src.ME || src.QueE) if(!step(src,NORTHEAST) && !step(src,NORTH)) step(src,EAST)
else if(src.MW || src.QueW) if(!step(src,NORTHWEST) && !step(src,NORTH)) step(src,WEST)
else step(src,NORTH)
else if(src.MS || src.QueS)
if(src.ME || src.QueE) if(!step(src,SOUTHEAST) && !step(src,SOUTH)) step(src,EAST)
else if(src.MW || src.QueW) if(!step(src,SOUTHWEST) && !step(src,SOUTH)) step(src,WEST)
else step(src,SOUTH)
else if(src.ME || src.QueE) step(src,EAST)
else if(src.MW || src.QueW) step(src,WEST)
In response to Lord Kakarot
I have no clue what those variables are, but by the looks of the step() logic, I can tell you that the library already lets you slide along walls. If what you're asking is "when the player slides along a wall, the player's dir is in the direction of movement instead of key input" then Forum_account's solution should work.
Did you run the code I posted? If so, how is it different than what you're trying to do?
*Sorry for the Links*
Here are the 2 demos, One is based on Byond's Pixel Movement and other one based on Forum Account's Pixel Movement, my Concern is more on how the diognal works Byond Pixel Movement.
Forum Account's Pixel Movement Based

Byond Based Pixel Movement Demo using my code shown above
In response to Lord Kakarot
Lord Kakarot wrote:
*Sorry for the Links*
Here are the 2 demos, One is based on Byond's Pixel Movement and other one based on Forum Account's Pixel Movement, my Concern is more on how the diognal works Byond Pixel Movement.
Forum Account's Pixel Movement Based

Byond Based Pixel Movement Demo using my code shown above

It's not a problem that you provided demos, but I'm still not sure what you're going for.

If you want to use all 8 directional states, you can use this code instead:

mob
movement()
..()

var/d = 0
if(move_x > 0)
d |= EAST
else if(move_x < 0)
d |= WEST

if(move_y > 0)
d |= NORTH
else if(move_y < 0)
d |= SOUTH

dir = d
In response to Forum_account
Forum_account wrote:
Lord Kakarot wrote:
*Sorry for the Links*
Here are the 2 demos, One is based on Byond's Pixel Movement and other one based on Forum Account's Pixel Movement, my Concern is more on how the diognal works Byond Pixel Movement.
Forum Account's Pixel Movement Based

Byond Based Pixel Movement Demo using my code shown above

It's not a problem that you provided demos, but I'm still not sure what you're going for.

If you want to use all 8 directional states, you can use this code instead:

> mob
> movement()
> ..()
>
> var/d = 0
> if(move_x > 0)
> d |= EAST
> else if(move_x < 0)
> d |= WEST
>
> if(move_y > 0)
> d |= NORTH
> else if(move_y < 0)
> d |= SOUTH
>
> dir = d
>

Thanks that solved my problem but now i am getting another problem which is when you host game with pixel movement, the movement lags
What do you mean by "the movement lags"? Due to network latency a game will never run as well over a network as it will when you run it locally, so some difference in performance should be expected.
In response to Lord Kakarot
Lord Kakarot wrote:
byond://67.210.108.209:39484

See For your self

That link isn't working. I've seen pixel movement work fine before, so if you're seeing a lot of lag it's most likely a problem with someone's internet connection.
In response to Forum_account
Forum_account wrote:
Lord Kakarot wrote:
byond://67.210.108.209:39484

See For your self

That link isn't working. I've seen pixel movement work fine before, so if you're seeing a lot of lag it's most likely a problem with someone's internet connection.

There i hosted it again but i dont know how long will it be on
Edit: Wrong port byond://67.210.108.209:3948 the right one