ID:179703
 
how would i make movementl ike on tanks?

im stumped..

ive tried alot of things. any help would be good


thanks
Pillsverry wrote:
how would i make movementl ike on tanks?

im stumped..

ive tried alot of things. any help would be good


thanks

this is my code:

client
South()
if(usr.dir == NORTH)
step(usr,SOUTH)
if(usr.dir == SOUTH)
step(usr,NORTH)
if(usr.dir == WEST)
Move(usr,EAST)
if(usr.dir == EAST)
Move(usr,WEST)

West()
usr.dir += turn(WEST, 45)
North()
step(usr,usr.dir)
East()
usr.dir += turn(EAST, 45)

i know its crap but i tried
In response to Pillsverry (#1)
how would i make movementl ike on tanks?

im stumped..

ive tried alot of things. any help would be good

It looks like you're thinking along the right lines, but just have a few details off. Here are a couple hints to get you going:

To move the object in its current direction:

M.Move(get_step(M, M.dir))

To rotate the object 45 degrees clockwise:

M.dir = turn(M.dir, -45)

Good luck!
In response to Gughunter (#2)
Gughunter wrote:
M.Move(get_step(M, M.dir))

Or simply
Step(M,M.dir)
;)