khymera
02-17-2009, 07:47 PM
I am looking to do a simple spin the bottle game in flash. I would like to know if any anyone can point me in the right direction.
The object "AKA Bottle" spins there a 6 predetermined landing areas:
So far have the spin button
on(press){
object.spinning = true
object.spin = 17 + Math.random()*20
object._rotation = object._rotation = 0
}
and the bottle object spinning to the button.
onClipEvent(enterFrame){
if (spinning){
if (spin <= 0){
spinning = false
rot = (_rotation < 0) ? 180 + _rotation : _rotation
_root.youSpunA = Math.floor(16 * rot/180)+1
}else{
_rotation += spin -= .25
_parent.wheel._rotation = -_rotation
}
}
}
I would like to if I can traceback the 6 predetermined positions so if the bottle lands on one of them an action can be performed, EX(bottle lands on point 1 message says you have to kiss player a, bottle lands on point 2 message says you have to kiss player b) nothing more If anyone can point me in the direction would be appreciated, kind of lost here.
Thanks
The object "AKA Bottle" spins there a 6 predetermined landing areas:
So far have the spin button
on(press){
object.spinning = true
object.spin = 17 + Math.random()*20
object._rotation = object._rotation = 0
}
and the bottle object spinning to the button.
onClipEvent(enterFrame){
if (spinning){
if (spin <= 0){
spinning = false
rot = (_rotation < 0) ? 180 + _rotation : _rotation
_root.youSpunA = Math.floor(16 * rot/180)+1
}else{
_rotation += spin -= .25
_parent.wheel._rotation = -_rotation
}
}
}
I would like to if I can traceback the 6 predetermined positions so if the bottle lands on one of them an action can be performed, EX(bottle lands on point 1 message says you have to kiss player a, bottle lands on point 2 message says you have to kiss player b) nothing more If anyone can point me in the direction would be appreciated, kind of lost here.
Thanks