Movement for pacman

New releases and general discussions.

Post » Sat Sep 04, 2010 12:28 am

random(2) will give you 0,1 or 2 from what I've seen so far. Maybe that requires a little messing around with .caps.
B
2
G
2
Posts: 42
Reputation: 734

Post » Sat Sep 04, 2010 1:42 am

[quote:ikm9x27w]random(2) will give you 0,1 or 2 from what I've seen so far. Maybe that requires a little messing around with .caps.[/quote:ikm9x27w]

Ok then would this be better? random(1)+1

[quote:ikm9x27w]First of all, you need to keep track of the angle of the ghost, so you know which direction it's moving in. Second of all, you need to check in the direction you're about to move with an overlap at offset check, before you move in that direction. Right now you change directions at random without making sure there's a wall in that direction first.[/quote:ikm9x27w]

I'm now tracking the direction but the offset doesn't appear to work.... or more correctly, I don't seem to understand it.

I've updated [url:ikm9x27w]http://www.rosmini.school.nz/downloads/pacman.cap[/url:ikm9x27w]
B
4
G
2
Posts: 42
Reputation: 811

Post » Sat Sep 04, 2010 10:59 am

In Construct Random(2) will return 0 or 1, but not 2.

A way that's simpler than checking for overlap at offset, just check for overlap. If it's true, undo the last movement and rotate 90 or -90.
[code:33czl20k]+ Ghost: Ghost overlaps Wall
-> Ghost: Move 0-Ghost[Bullet].Speed*TimeDelta pixels at Ghost.Angle degrees
-> Ghost: Rotate {90,-90} @ (Random(2)+1) degrees clockwise
[/code:33czl20k]
B
79
S
24
G
54
Posts: 4,746
Reputation: 40,755

Post » Sat Sep 04, 2010 8:42 pm

[quote="abasel":e0ons85v][cut][/quote:e0ons85v]
You could enhance the AI developing a wall detection engine, using Custom Movement behavior.
For example:
http://www.box.net/shared/dyhh7oadnf
B
2
G
3
Posts: 9
Reputation: 868

Post » Fri Sep 10, 2010 11:03 am

B
2
S
1
G
2
Posts: 10
Reputation: 820

Post » Tue Sep 14, 2010 12:22 am

Hi, when I try and open it, I get an out of memory error.

Cheers
B
4
G
2
Posts: 42
Reputation: 811

Post » Tue Sep 14, 2010 10:07 am

Update to 99.94
B
2
S
1
G
2
Posts: 10
Reputation: 820

Previous

Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 3 guests