Top down movement

For questions about using Classic.

Post » Sat Aug 14, 2010 8:12 pm

I think you could put a restriciton to rotating, put the angledifference as timer countdown before it is able to turn to other side, meaning it must slow down by decreasing angledifference before it can rotate to other side...
B
3
G
4
Posts: 54
Reputation: 1,183

Post » Sun Aug 15, 2010 9:00 pm

I have no idea how to use the timer stuff in Construct :S

I've been looking into some tutorials on the implementation of heat seeking behaviour... technically it's the same thing, the target is just the mouse. Plus it'll be great for enemy AI later on. Can't seem to get anywhere with it though :(

[url:e1upi9c9]http://gpwiki.org/index.php/Heat_Seeker[/url:e1upi9c9]
B
15
S
6
G
6
Posts: 103
Reputation: 2,968

Post » Mon Aug 16, 2010 1:53 am

Here's a way to eliminate the jerk in the movement by using a variable that keeps track of the total angle change and reducing the variable whenever the object angle is changed. Hope that helps.

req 0.99.92
[url:3d2zvg42]http://dl.dropbox.com/u/5426011/examples/angaccum.cap[/url:3d2zvg42]
B
79
S
24
G
54
Posts: 4,746
Reputation: 40,755

Post » Mon Aug 16, 2010 2:01 am

Exactly 110% what I wanted it to do. R0J0hound, I love you.

Here's a link to a picture of some cake for your trouble: Cake
B
15
S
6
G
6
Posts: 103
Reputation: 2,968

Post » Mon Aug 16, 2010 5:41 am

Ah, 'Is Clockwise Of'... that's pretty much what I was lookin' for!
B
2
S
1
G
2
Posts: 35
Reputation: 870

Post » Mon Aug 16, 2010 8:37 pm

Might have found a bug here, or maybe I'm doing something wrong. Last night I attempted to merge rojohounds example into my original project, and it refused to work. Eventually I stripped it back so that mine was basically event for event identical to the example, even down to the event ordering. At that point it miraculously began to work. This is keeping in mind that in rojohounds example, the target is the mouse pointer and in mine, the target was a sprite X/Y which was placed at the location of the mouse in the Always event.

Anyways, I thought Construct was just having a bit of a funny turn and left it. I was experimenting just now seeing if I could get a target to move in a restricted circle around my ship. The cap I've posted doesnt work. However, if you change the references to 'Target.x' and 'Target.y' in the set target position line to instead be mouse coordinates mousex and mouse y, it works (not properly but that's because I only just started playing with this)

See if anyone else has a problem

[url:1f2lo8z0]http://www.mediafire.com/?5q5kn9dsxp3gb92[/url:1f2lo8z0]

It would seem that there's some problem working out an angle between two objects, but it''s fine when using an object and the mouse?
B
15
S
6
G
6
Posts: 103
Reputation: 2,968

Previous

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 1 guest