8 direction movement not right, sprite jumps

For questions about using Classic.

Post » Thu Jan 31, 2008 10:05 pm

I once made a text based RPG game in php/mysql yes, sold it for 200 as well :)
B
3
S
2
G
5
Posts: 301
Reputation: 2,302

Post » Thu Jan 31, 2008 11:18 pm

Uh-oh, mom and dad are fighting again :(

Oh and just an FYI, there's nothing inverted about y- being up and y+ being down. This is how pixel coordinates have always worked since cavemen chiseled the first raster graphics into the granite walls of their caves.

The top left of the layout will always be 0x, 0y. X counts upward toward the right edge, and y counts upwards toward the bottom edge. In a screen resolution of 640x480, you get this:

[code:qgo86m4s]
0,0---------------- Y = 0 --------------640,0
| |
| |
| |
| |
| |

X = 0 X = 640

| |
| |
| |
| |
| |
0,480------------- Y = 480 -----------640,480
[/code:qgo86m4s]

So it stands to reason that if you want an object to move downward, you add to it's y coordinate, and if you want it to move upward, you subtract from it's y coordinate.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Fri Feb 01, 2008 12:50 am

I would have thought that is how it worked anyone for some reason, got it in my head, just can't explain it kinda thing, thanks for the tips anyway guys :)
B
3
S
2
G
5
Posts: 301
Reputation: 2,302

Previous

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests