prefuse / Flare

Flare is an ActionScript library for creating visualizations that run in the Adobe Flash Player. From basic charts and graphs to complex interactive graphics, the toolkit supports data management, visual encoding, animation, and interaction techniques.
http://flare.prefuse.org
Other
347 stars 80 forks source link

Avatar gets hung up on jagged walls, trees, rocks and stupid things #5

Closed daniel-santos closed 12 years ago

daniel-santos commented 12 years ago

This is kinda annoying. hmm, not sure how to attach patches on github....

daniel-santos commented 12 years ago

From b4b61c7f73a04d3cfcb7e8a703fcfa66aa1f2a16 Mon Sep 17 00:00:00 2001 From: Daniel Santos daniel.santos@pobox.com Date: Wed, 18 Apr 2012 02:27:14 -0500 Subject: Don't get stuck on jagged walls, stray rocks and sticky-outy things.

When traveling straight (not diagonally), and we hit an object, but if one step to the left or right (relative to our direction of travel) there is a valid path, then desist movement in the requested direction and travel towards the clear path on the other axis until we can proceed

forward in the requested direction.

src/MapCollision.cpp | 81 ++++++++++++++++++++++++++++++++++++++++++------- src/MapCollision.h | 4 ++ 2 files changed, 73 insertions(+), 12 deletions(-)

diff --git a/src/MapCollision.cpp b/src/MapCollision.cpp index 5809e2b..c198532 100644 --- a/src/MapCollision.cpp +++ b/src/MapCollision.cpp @@ -48,10 +48,9 @@ void MapCollision::setmap(unsigned short _colmap[256][256]) { */ bool MapCollision::move(int &x, int &y, int step_x, int step_y, int dist) {

- if (step_x != 0 && step_y != 0) diag = true;

daniel-santos commented 12 years ago

sorry, wrong project! was intended for clintbellanger/flare