// Handlers for left right events from the joystick public static void leftEventFired(MasterMind mm) { if (mm.getCurrentLeftRight() == 1) return; mm.setCurrentLeftRight(mm.getCurrentLeftRight() - 1); if (mm.getCurrentLeftRight() == 1) { mm.getRb2().OutlineColor = GHI.Glide.Colors.White; mm.getRb2().Invalidate(); mm.getRb1().OutlineColor = GHI.Glide.Colors.Red; mm.getRb1().Invalidate(); } if (mm.getCurrentLeftRight() == 2) { mm.getRb3().OutlineColor = GHI.Glide.Colors.White; mm.getRb3().Invalidate(); mm.getRb2().OutlineColor = GHI.Glide.Colors.Red; mm.getRb2().Invalidate(); } if (mm.getCurrentLeftRight() == 3) { mm.getRb4().OutlineColor = GHI.Glide.Colors.White; mm.getRb4().Invalidate(); mm.getRb3().OutlineColor = GHI.Glide.Colors.Red; mm.getRb3().Invalidate(); } }
public static void rightEventFired(MasterMind mm) { if (mm.getCurrentLeftRight() == 4) { return; } mm.setCurrentLeftRight(mm.getCurrentLeftRight() + 1); if (mm.getCurrentLeftRight() == 2) { mm.getRb1().OutlineColor = GHI.Glide.Colors.White; mm.getRb1().Invalidate(); mm.getRb2().OutlineColor = GHI.Glide.Colors.Red; mm.getRb2().Invalidate(); } if (mm.getCurrentLeftRight() == 3) { mm.getRb2().OutlineColor = GHI.Glide.Colors.White; mm.getRb2().Invalidate(); mm.getRb3().OutlineColor = GHI.Glide.Colors.Red; mm.getRb3().Invalidate(); } if (mm.getCurrentLeftRight() == 4) { mm.getRb3().OutlineColor = GHI.Glide.Colors.White; mm.getRb3().Invalidate(); mm.getRb4().OutlineColor = GHI.Glide.Colors.Red; mm.getRb4().Invalidate(); } }