Hi!
I'm currently doing a method that is supposed to return a direction constant(8 different valid directions) just by receiving the delta-coordinates from the current position. (-1,-1) would be UPLEFT for example.
Currently I just use comparison and then return the right constant but I think from my time using RPGMakerVX RGSS2 that somewhere in all the code there was a move(x,y) method that did the same thing but calculated the direction with math which I guess would make the whole process more efficient.
Problem is that I don't really know how to do this with only the allowed integral values of 0-7. I remember good ol' cos and sin from school but don't think RPGMakerVX used that in their system... Although RPGMakerVX only have 4 directions so probably have to be different from their way.
Help appreciated. Thanks!
Calculating 2D rotation with 8 directions
Started by Groogy, Jun 14 2010 10:27 AM
2 replies to this topic
#1
Posted 14 June 2010 - 10:27 AM
|
|
|
#2
Posted 14 June 2010 - 05:42 PM
I'm sorry, but i can't help you. Maybe you could try posting in the section in what language your programming to get more responses!
Good luck!
Good luck!
#3
Posted 14 June 2010 - 07:36 PM
I would but they don't seem to have a Ruby programming forum here.


Sign In
Create Account


Back to top









