cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
How to move a ghost in PacMan game rando
How to move a ghost in PacMan game randomly around the maze?
Oct 1, 2014 at 8:24am UTC
SaQi
(2)
I have tried rand() for x and y positions of ghost but does not work. it moves but not randomly it follows same path every time I run the code.
Oct 1, 2014 at 8:36am UTC
Lachlan Easton
(699)
You need to seed the random number generator first.
http://www.cplusplus.com/reference/cstdlib/rand/
If you're using C++11
http://www.cplusplus.com/reference/random/
Oct 1, 2014 at 10:17am UTC
SaQi
(2)
I have done it but still it follows the same path :(
Topic archived. No new replies allowed.