Values

Risbo

  • Posts: 33
Well hello everybody here i am again, i got a new idea for my new game and im strugling to do some things so any help would be great....the circles are rotating light and when you got 2 same colors touching  you touch that space and you get points now how can i do that  the yellow half of circle has a different value then the other half and i dont wanna that you get points if the colors not mach if you know what i mean.

« Last Edit: March 28, 2014, 03:17:52 am by Risbo »

Tuo

  • *
  • Posts: 2469
In the actor -> position and motion palettes, you can determine the rotational speed of the actors and get the current direction of the actor. Use the first to start the actors moving (and change it on the fly if you want), and then use the second inside of conditionals to see if the colors are lined up or not. It will take a bit of doing for the second part, but it is possible, something like this:

if mouse was pressed on self
   if |direction of self - 90| < 90 and |direction of adjacent actor - 45| < 90
       increment points by 1

Be careful with the rotations as they can go beyond the 0 to 360 degrees (into negatives or into bigger numbers), so you'll want some catch to keep it in range (i.e. if direction of self > 360, point self in [direction of self - 360])
Don't look to me but rather to the One who is the reason for what I do. :)

If you need help, send me a PM. Even if I haven't been on in the forums in ages, I still receive those messages via email notifications. You can also reply to any of my forum posts, regardless of the age (especially if I created it), and I will likely reply.

If you want to see the programming behind certain types of games, feel free to check out my "Demo-" games on StencylForge (http://community.stencyl.com/index.php/topic,16160.0.html)