My Death Platoon Question Dump

For questions about using Classic.

Post » Thu Dec 04, 2008 2:47 pm

Hello i plan ta ask all my question related to my project Death platoon here
[url:30j5t0qj]http://www.scirra.com/phpBB3/viewtopic.php?f=4&t=2069[/url:30j5t0qj]
So anyhow can find help here.
B
2
S
1
G
4
Posts: 114
Reputation: 1,528

Post » Thu Dec 04, 2008 3:14 pm

First question:
what is the best way to keep an object at a certain distance one to another.
For instance i dont want my target to get too close of my player. so i tought adding a circular invisible sprite at the same pos as my player to act as a collision zone that intereact only with my target...

What do you think?
B
2
S
1
G
4
Posts: 114
Reputation: 1,528

Post » Thu Dec 04, 2008 3:54 pm

[quote="Border":z6sxi6od]First question:
what is the best way to keep an object at a certain distance one to another.
For instance i dont want my target to get too close of my player. so i tought adding a circular invisible sprite at the same pos as my player to act as a collision zone that intereact only with my target...

What do you think?[/quote:z6sxi6od]

I think that in some situations, more simple way is just test if the distance of the objects is under/over a certain threshold. The function is distance(x1, y1, x2, y2). In my opinion, there's no need for unneccessary sprite clutter if it can be done easily via events. :D
B
3
S
2
G
5
Posts: 263
Reputation: 2,201

Post » Thu Dec 04, 2008 4:00 pm

Drasa's right, if you can do it easily without collision events then that's always better. The distance expression is just one line of code, so it'll be easy to implement.

[code:2i585vw1]+For each enemy
+distance(enemyX, enemyY, playerX, playerY) is less than 100
-> move away code (or flag)
+else
-> move towards code (or flag)[/code:2i585vw1]

where 100 is the number of pixels radius you want.

You might need some sort of intermediary event to smooth out the moving towards/moving away actions though, or your enemies might jitter back and forth at the edge of the boundary.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Fri Dec 05, 2008 5:29 am

OK i might sound stupid but should i test it.
anyways i'm tired and my brain is off so .. yeah. thats normal.

Daily Build!
-Mainly graphic .
Animated level Yeah!!!!
-more enemey.



bleh
[url:17ar5sud]http://www.mediafire.com/download.php?n5zyy5yzqzr[/url:17ar5sud]
B
2
S
1
G
4
Posts: 114
Reputation: 1,528

Post » Sun Dec 07, 2008 2:46 am

wow hey how can i edit my post. Except the one i just created i can''t edit any.
Sorry guys i realised what i wrote did'nt make any sense.
Ok so to reformulate, where should i put this code Deadeye.
I'm pretty much working on trial and error now and is slow as hell. :D
But at still i learn a lot.
B
2
S
1
G
4
Posts: 114
Reputation: 1,528

Post » Sun Dec 07, 2008 3:37 am

I don't know where you should put it. It's just a concept. You'll have to figure out how to implement it, because you know your code better than I do.

And if it doesn't exactly fit with what you have coded then you'll have to figure out how to tweak it so it does.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Sun Dec 07, 2008 4:19 am

ahh . oh okay then, i didn't realise it was pseudocode.
Well i'm gonna try to find it right away
[quote:sal76gga]because you know your code better than I do.[/quote:sal76gga]
your mother never told you not to tel lies. ;)
BTW do we have somewhere a list of all those function understand by construct. Like the Distance one?
B
2
S
1
G
4
Posts: 114
Reputation: 1,528

Post » Sun Dec 07, 2008 8:36 am

[quote="Border":3689dvx0]BTW do we have somewhere a list of all those function understand by construct. Like the Distance one?[/quote:3689dvx0]

http://apps.sourceforge.net/mediawiki/c ... sions#Math
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Sun Dec 07, 2008 2:22 pm

super duper thanksalotman!!
B
2
S
1
G
4
Posts: 114
Reputation: 1,528

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 4 guests