Constrain to circle DEMO
Hey All,
Here is a demo showing how to constrain the dragging region of an actor to a circular area:
http://gamesalad.com/game/play/71909
This could be used in a variety of ways - limiting the possible distance an actor can move in a turn, limiting the power of a slingshot or projectile, etc., etc...
Feel free to use this in any way you want!
Joe
Fire Maple Games
Here is a demo showing how to constrain the dragging region of an actor to a circular area:
http://gamesalad.com/game/play/71909
This could be used in a variety of ways - limiting the possible distance an actor can move in a turn, limiting the power of a slingshot or projectile, etc., etc...
Feel free to use this in any way you want!
Joe
Fire Maple Games
Comments
Good demo.
It all happens because I was searching the forum and I read a post about how good it was. I download the lite and 5 minutes later I was buying the complete one. like in level 10 I stop to make me a cup of coffee, my wife grabs the iphone and start playing, then she did not want to stop. In my house we have an iphone and two ipods I put the game in the 3 devices because my 3 kids wanted to play it to. We were five and there were only 3 devices so we divided the time so everybody played for 10 minutes and pass it, 10 minutes and pass it and so on. Of course that was after everybody got to level 10 because that was the level I was. We spent four hours playing it. It was so funny, I got Silver, almost got gold but went over by 38 seconds...
Any way, just wanted to share that with you,
Super nice game...
Ps- Next weekend will have Stunt Squirrels tournament...
@LordTarantor: Thanks so much! That's so awesome! I'm so glad you guys enjoyed the game! I plan on making the sequel when I finally finish the current game I am working on.
BTW, You can also play both games for free on www.gamesalad.com in the games section:
Danger Cats!: http://gamesalad.com/game/play/30122
Stunt Squirrels!: http://gamesalad.com/game/play/34565
By any chance do you have a GS formula for determining if a point is within a polygonal region? I've been trying to get the following working in GS and have only gotten mixed results. Trying to rewrite it in GS has been a major headache -- I'm wondering if you might have already done something similar. Thanks in advance for any suggestions.
int pnpoly(int npol, float *xp, float *yp, float x, float y)
{
int i, j, c = 0;
for (i = 0, j = npol-1; i < npol; j = i++) {
if ((((yp[i] <= y) && (y < yp[j])) ||
((yp[j] <= y) && (y < yp[i]))) &&
(x < (xp[j] - xp[i]) * (y - yp[i]) / (yp[j] - yp[i]) + xp[i]))
c = !c;
}
return c;
}
I got it working and made a demo here:
http://gamesalad.com/game/play/71942
It is definitely a bit tedious to set up the rules, but it is certainly doable. I made a triangle to start with, but a polygon with any amount of sides is possible.
Can I offer you anything in exchange for your efforts? I would offer some design/graphics work but I believe you already do this kind of stuff. Still, I would happy to do something in trade.
And you don't owe me anything. I'm glad to help. Plus it gives my brain a little workout which I appreciate. My new game has a ton of art and animation assets and I feel like I've been working in an art assembly line for the past coupe of weeks!
i tried to replicate the demo in my game but i can only get it to move once and then cant move it any more. everything is the same as the demo yet i can't make it work. is there something hidden that i might have missed?
thanks