so, you did write some code to test JPS and find out is is slower than ASTAR or you just think it is slower?
- Viewing Profile: Posts: DpakoH
Community Stats
- Group Members
- Active Posts 197
- Profile Views 1,942
- Member Title Member
- Age 27 years old
- Birthday July 27, 1985
-
Gender
Male
-
Location
Bulgaria, Sofia
-
Interests
GD, chess, sports
User Tools
Latest Visitors
Posts I've Made
In Topic: Jump point search(jps) algorithm is slow than classic AStar?
21 March 2013 - 09:14 AM
In Topic: THE COLD WAR ERA
17 March 2013 - 02:20 AM
Congrats on the game, but can't you post some screenshots or even videos?
In Topic: Detect single mouseclick - move sprite
25 February 2013 - 08:47 AM
i think you are doing it wrong.
var currentMouseState = Mouse.GetState(); var lastMouseState = currentMouseState;
this is wrong, should be
var lastMouseState = currentMouseState; var currentMouseState = Mouse.GetState(); if (lastMouseState.LeftButton == ButtonState.Pressed && currentMouseState.LeftButton == ButtonState.Released){ ... }I don't think that'll work.
var lastMouseState = currentMouseState; var currentMouseState = Mouse.GetState();
That's saying that you are assigning (and declaring) lastMouseState and assigning it currentMouseState. But.. that's not even declared yet. 2nd line is "var currentMouseState" and assigns that variable "Mouse.GetState();" which means.. you would be assigning a variable that isn't even declared yet to a new variable. So that would most likely throw an error.
currentMouseState is initialized when it is declared, as follows:
protected MouseState lastMouseState; protected MouseState currentMouseState = Mouse.GetState();
and the code i posted is placed in the Update method. furthermore this statement
if (newState.LeftButton == ButtonState.Pressed && oldState.LeftButton == ButtonState.Released)
is wrong, at least the logic is wrong.
In Topic: StarLife - an indie sci-fi 4X in development
25 February 2013 - 07:17 AM
great job! i really liked your screenshots on your site! ![]()
In Topic: Detect single mouseclick - move sprite
25 February 2013 - 07:13 AM
i think you are doing it wrong.
var currentMouseState = Mouse.GetState(); var lastMouseState = currentMouseState;
this is wrong, should be
var lastMouseState = currentMouseState;
var currentMouseState = Mouse.GetState();
if (lastMouseState.LeftButton == ButtonState.Pressed && currentMouseState.LeftButton == ButtonState.Released){
...
}
- Home
- » Viewing Profile: Posts: DpakoH

Find content