62 reputation
6
bio website
location
age
visits member for 1 year, 6 months
seen Nov 9 '13 at 6:13

Sep
6
comment Finding a normal vector
That said, my walls are all oriented along the x and y axis (no diagonal walls) which hadn't occurred to me, so all my normals will be the 4 you listed. That would make the distance test more reasonable. I was thinking that wouldn't work if there were diagonal walls, but there aren't. Thanks!
Sep
6
comment Finding a normal vector
Not exactly - I want to alter the player's direction of movement so that he moves parallel to the wall after collision, instead of moving through the wall or stopping. To do that you have to remove the normal from the movement vector of the player. The question is determining which normal to use.
Sep
6
asked Finding a normal vector
Sep
4
accepted Twitchy sprite movement
Sep
4
awarded  Commentator
Sep
4
comment Twitchy sprite movement
The only integers are at the draw method, g.fillRect((int) position.x, (int) position.y, 64, 64);
Sep
4
comment Twitchy sprite movement
That makes sense, but I think there must be some additional problem - I just set the speed to 0.1 and it shivered the whole way and when it finally landed it shivered forever. I don't doubt you're assessment is right, but slowing it down alone isn't the solution, I think.
Sep
4
comment Twitchy sprite movement
Well, its 6.0 currently, and when I reduce it to 1.0 it still does it, just very slowly. If it were an overshoot, it wouldn't twitch on the path, would it?
Sep
4
asked Twitchy sprite movement
Mar
23
awarded  Teacher
Mar
23
accepted Inventory Grid Detection
Mar
23
answered Inventory Grid Detection
Mar
23
comment Inventory Grid Detection
Final comment! Your solution is in fact the same as what I'm doing (but it is waaay neater) - my problem was in placing the item. The formula I ended up with is slot = 5*rowPos + colPos and now it works. Thanks all the same, you made me examine my code more closely.
Mar
23
comment Inventory Grid Detection
Actually, this only solves half my problem. See, the inventory is an ArrayList, not a 2D array, so I can't just put the item in [x][y], I have to turn x and y into a slot ID between 0-39. I had that as x + 4*y, but that doesn't seem to be playing well. Any ideas?
Mar
23
comment Inventory Grid Detection
This makes a lot of sense, though I feel like it's almost exactly what I'm doing, just neater. I'm gonna play around with this, and see if it works better. Also, thanks! I like my metal dude.
Mar
23
comment Inventory Grid Detection
Added pictures to the post.
Mar
23
revised Inventory Grid Detection
added 628 characters in body
Mar
23
comment Inventory Grid Detection
Thanks, but that's not my problem. Picking up the item (making it follow the mouse and then replacing it in the inventory) works just fine, its the placing it in the right slot on the grid (visual problem).
Mar
23
awarded  Editor
Mar
23
revised Inventory Grid Detection
deleted 165 characters in body