projects
/
supertux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
play sound when willowisp is caught
[supertux.git]
/
src
/
object
/
path_walker.hpp
diff --git
a/src/object/path_walker.hpp
b/src/object/path_walker.hpp
index
9f237ef
..
f3bdf9e
100644
(file)
--- a/
src/object/path_walker.hpp
+++ b/
src/object/path_walker.hpp
@@
-32,7
+32,7
@@
class PathWalker
{
public:
class PathWalker
{
public:
- PathWalker(const Path* path);
+ PathWalker(const Path* path
, bool running = true
);
virtual ~PathWalker();
/**
virtual ~PathWalker();
/**
@@
-41,16
+41,33
@@
public:
*/
virtual Vector advance(float elapsed_time);
*/
virtual Vector advance(float elapsed_time);
+ /** advance until at given node, then stop */
+ void goto_node(int node_no);
+
+ /** start advancing automatically */
+ void start_moving();
+
+ /** stop advancing automatically */
+ void stop_moving();
+
const Path* path;
private:
void advance_node();
void goback_node();
const Path* path;
private:
void advance_node();
void goback_node();
-
+
+ /**
+ * set to false to immediately stop advancing
+ */
+ bool running;
+
size_t current_node_nr;
size_t next_node_nr;
size_t current_node_nr;
size_t next_node_nr;
- Vector last_pos;
+ /**
+ * stop advancing automatically when this node is reached
+ */
+ int stop_at_node_nr;
/**
* the position between the current node and the next node as fraction
/**
* the position between the current node and the next node as fraction