HI I have it now like this. With the Move and Player class.
for testing I put the move Method also in the Player class.
But the Player doesnt move.
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
FroglegPosted Feb 9, 2012, 4:20 AM
public Point playerMove(Mover.Direction direction,Rectangle boundaries,Point location)
{
player.Move(direction,boundaries,location);//Moves the player
//Console.WriteLine(location);
return location;// you returned original location
}
should be
public Point playerMove(Mover.Direction direction,Rectangle boundaries,Point location)
{
Point p;
p = player.Move(direction,boundaries,location);//Moves the player
//Console.WriteLine(location);
return p;
}
albert albertPosted Feb 9, 2012, 4:26 AM
stupid of me that I forgot to past the Point variable to the Move method.
This works ofcourse. To past directly the parameter location to the Move method;
[code]
public Point MovePlayer(Mover.Direction direction,Rectangle boundaries,Point location)
{
//boundaries = new Rectangle(0, 0, 600, 600);
//Point p;
location = player.Move(direction,boundaries,location);//Moves the player
Console.WriteLine(location);
return location;
}
[/code]