public override void Alter(LTimerContext c) { // ��ʼ����� if (IsOnLoadComplete()) { // ����δ�ﵽ�����Ե if (title.GetX() + title.GetWidth() + 25 <= GetWidth()) { // ���������ƶ�����ɫ�ǡ����� title.Move_right(3); } else { // �趨��ʼ��ť���� start.SetEnabled(true); // �趨������ť���� end.SetEnabled(true); } } }
public override void Alter(LTimerContext c) { }
public override void DoMain() { m_game.OnStateLog(m_log); LSystem.isResume = false; LSystem.isPaused = false; LSystem.isDestroy = false; timerContext = new LTimerContext(); timer = LSystem.GetSystemTimer(); if (m_game != null) { GameType type = m_game.GetGameType(); if (type != null) { Register(type.setting, type.mainType, type.args); } } Printf("doMain"); }
internal void Update(LTimerContext c) { switch (type) { case DRAW_USER: lock (this) { screen.Alter(c); } break; case DRAW_SPRITE: lock (this) { screen.spriteRun = (screen.sprites != null && screen.sprites.Size() > 0); if (screen.spriteRun) { screen.sprites.Update(c.timeSinceLastUpdate); } } break; case DRAW_DESKTOP: lock (this) { screen.desktopRun = (screen.desktop != null && screen.desktop.Size() > 0); if (screen.desktopRun) { screen.desktop.Update(c.timeSinceLastUpdate); } } break; } }
public abstract void Alter(LTimerContext timer);
public virtual void RunTimer(LTimerContext timer) { if (isClose) { return; } if (replaceLoading) { if (replaceDstScreen == null || !replaceDstScreen.IsOnLoadComplete()) { Process(timer); } else if (replaceDstScreen.IsOnLoadComplete()) { Process(timer); if (replaceDelay.Action(timer)) { switch (replaceMethod) { case MoveMethod.FROM_LEFT: dstPos.Move_right(replaceScreenSpeed); if (dstPos.X() >= 0) { SubmitReplaceScreen(); return; } break; case MoveMethod.FROM_RIGHT: dstPos.Move_left(replaceScreenSpeed); if (dstPos.X() <= 0) { SubmitReplaceScreen(); return; } break; case MoveMethod.FROM_UP: dstPos.Move_down(replaceScreenSpeed); if (dstPos.Y() >= 0) { SubmitReplaceScreen(); return; } break; case MoveMethod.FROM_DOWN: dstPos.Move_up(replaceScreenSpeed); if (dstPos.Y() <= 0) { SubmitReplaceScreen(); return; } break; case MoveMethod.OUT_LEFT: dstPos.Move_left(replaceScreenSpeed); if (dstPos.X() < -GetWidth()) { SubmitReplaceScreen(); return; } break; case MoveMethod.OUT_RIGHT: dstPos.Move_right(replaceScreenSpeed); if (dstPos.X() > GetWidth()) { SubmitReplaceScreen(); return; } break; case MoveMethod.OUT_UP: dstPos.Move_up(replaceScreenSpeed); if (dstPos.Y() < -GetHeight()) { SubmitReplaceScreen(); return; } break; case MoveMethod.OUT_DOWN: dstPos.Move_down(replaceScreenSpeed); if (dstPos.Y() > GetHeight()) { SubmitReplaceScreen(); return; } break; case MoveMethod.FROM_UPPER_LEFT: if (dstPos.Y() < 0) { dstPos.Move_45D_right(replaceScreenSpeed); } else { dstPos.Move_right(replaceScreenSpeed); } if (dstPos.Y() >= 0 && dstPos.X() >= 0) { SubmitReplaceScreen(); return; } break; case MoveMethod.FROM_UPPER_RIGHT: if (dstPos.Y() < 0) { dstPos.Move_45D_down(replaceScreenSpeed); } else { dstPos.Move_left(replaceScreenSpeed); } if (dstPos.Y() >= 0 && dstPos.X() <= 0) { SubmitReplaceScreen(); return; } break; case MoveMethod.FROM_LOWER_LEFT: if (dstPos.Y() > 0) { dstPos.Move_45D_up(replaceScreenSpeed); } else { dstPos.Move_right(replaceScreenSpeed); } if (dstPos.Y() <= 0 && dstPos.X() >= 0) { SubmitReplaceScreen(); return; } break; case MoveMethod.FROM_LOWER_RIGHT: if (dstPos.Y() > 0) { dstPos.Move_45D_left(replaceScreenSpeed); } else { dstPos.Move_left(replaceScreenSpeed); } if (dstPos.Y() <= 0 && dstPos.X() <= 0) { SubmitReplaceScreen(); return; } break; case MoveMethod.OUT_UPPER_LEFT: dstPos.Move_45D_left(replaceScreenSpeed); if (dstPos.X() < -GetWidth() || dstPos.Y() <= -GetHeight()) { SubmitReplaceScreen(); return; } break; case MoveMethod.OUT_UPPER_RIGHT: dstPos.Move_45D_up(replaceScreenSpeed); if (dstPos.X() > GetWidth() || dstPos.Y() < -GetHeight()) { SubmitReplaceScreen(); return; } break; case MoveMethod.OUT_LOWER_LEFT: dstPos.Move_45D_down(replaceScreenSpeed); if (dstPos.X() < -GetWidth() || dstPos.Y() > GetHeight()) { SubmitReplaceScreen(); return; } break; case MoveMethod.OUT_LOWER_RIGHT: dstPos.Move_45D_right(replaceScreenSpeed); if (dstPos.X() > GetWidth() || dstPos.Y() > GetHeight()) { SubmitReplaceScreen(); return; } break; default: break; } replaceDstScreen.RunTimer(timer); } } } else { Process(timer); } }
private void Process(LTimerContext timer) { this.elapsedTime = timer.GetTimeSinceLastUpdate(); if (!isClose) { if (isGravity) { gravityHandler.Update(elapsedTime); } if (fristPaintFlag) { fristOrder.Update(timer); } if (secondPaintFlag) { secondOrder.Update(timer); } if (lastPaintFlag) { lastOrder.Update(timer); } } this.touchDX = touchX - lastTouchX; this.touchDY = touchY - lastTouchY; this.lastTouchX = touchX; this.lastTouchY = touchY; this.touchButtonReleased = NO_BUTTON; }
public void RunTimer(LTimerContext context) { if (isInstance) { if (waitTransition) { if (transition != null) { switch (transition.code) { default: if (!currentControl.IsOnLoadComplete()) { transition.Update(context.timeSinceLastUpdate); } break; case 1: if (!transition.Completed()) { transition.Update(context.timeSinceLastUpdate); } else { EndTransition(); } break; } } } else { currentControl.RunTimer(context); return; } } }
public override void Alter(LTimerContext c) { // 初始化完毕 if (IsOnLoadComplete()) { // 标题未达到窗体边缘 if (title.GetX() + title.GetWidth() + 25 <= GetWidth()) { // 以三倍速移动(红色无角……) title.Move_right(3); } else { // 设定开始按钮可用 start.SetEnabled(true); // 设定结束按钮可用 end.SetEnabled(true); } } }
public override void Alter(LTimerContext timer) { for (int i = 0; i < keySize; i++) { ActionKey act = (ActionKey)keyActions.Get(i); if (act.IsPressed()) { act.Act(elapsedTime); if (act.isReturn) { return; } } } if (content.IsVisible()) { ProcessEvents(); content.UpdateNode(timer.GetMilliseconds()); } if (follow != null) { foreach (TileMap tile in tiles) { float offsetX = GetHalfWidth() - follow.GetX(); offsetX = MathUtils.Min(offsetX, 0); offsetX = MathUtils.Max(offsetX, GetWidth() - tile.GetWidth()); float offsetY = GetHalfHeight() - follow.GetY(); offsetY = MathUtils.Min(offsetY, 0); offsetY = MathUtils .Max(offsetY, GetHeight() - tile.GetHeight()); SetOffset(tile, offsetX, offsetY); tile.Update(elapsedTime); } } foreach (SpriteBatchObject o in objects) { o.Update(elapsedTime); if (updateListener != null) { updateListener.Act(o, elapsedTime); } } Update(elapsedTime); Commits(); }
public override void Alter(LTimerContext timer) { if (!IsOnLoadComplete()) { return; } gameTime.Update(timer); if (!isInit) { LoadContent(); } gameCollection.Update(gameTime); if (drawablesToUpdate.Count > 0) { CollectionUtils.Clear(drawablesToUpdate); } foreach (Drawable drawable in drawables) { CollectionUtils.Add(drawablesToUpdate, drawable); } bool otherScreenHasFocus = false; bool coveredByOtherScreen = false; Drawable _drawable; int screenIndex; for (; drawablesToUpdate.Count > 0; ) { screenIndex = drawablesToUpdate.Count - 1; _drawable = drawablesToUpdate[screenIndex]; CollectionUtils.RemoveAt(drawablesToUpdate, screenIndex); if (_drawable._enabled) { _drawable.Update(gameTime, otherScreenHasFocus, coveredByOtherScreen); if (_drawable.GetDrawableState() == Painting.DrawableState.TransitionOn || _drawable.GetDrawableState() == Painting.DrawableState.Active) { if (!otherScreenHasFocus) { _drawable.HandleInput(this); otherScreenHasFocus = true; } if (!_drawable.IsPopup) { coveredByOtherScreen = true; } } } } Update(gameTime); }
public override void Alter(LTimerContext t) { if (IsWait()) { return; } if (timer1 == null) { timer1 = new LTimer(50); } if (title != null && timer1.Action(t.GetTimeSinceLastUpdate())) { if (title.GetY() > 50) { title.Move_up(8); title.ValidatePosition(); } else if (title.GetAlpha() > 0.2f) { title.SetAlpha(title.GetAlpha() - 0.1f); } else { title.SetVisible(false); Remove(title); title = null; } return; } else if (over != null && timer1.Action(t.GetTimeSinceLastUpdate()) && !overFlag) { if (over.GetY() < (GetHeight() - over.GetHeight()) / 2) { over.Move_down(8); over.ValidatePosition(); } else if (over.GetAlpha() < 1.0f) { over.SetAlpha(over.GetAlpha() + 0.1f); } else { CenterOn(over); overFlag = true; } return; } if (!wingame) { if (timer == null) { timer = new LTimer(100); } if (timer.Action(t.GetTimeSinceLastUpdate())) { if (progress != null) { progress.SetUpdate(progress.GetValue() - (stageNo*30)); if (progress.GetValue() <= 100 && !failgame) { failgame = true; GetSprites().SetVisible(false); over = new LPaper(GetImage(16), 0, 0); over.Click = new OverClick(); over.SetAlpha(0.1f); CenterOn(over); over.SetY(0); Add(over); } } } } else { wingame = false; RemoveAll(); Stage(stageNo + 1); } }
public override void Alter(LTimerContext timer) { for (int i = 0; i < keySize; i++) { ActionKey act = (ActionKey)keyActions.Get(i); if (act.IsPressed()) { act.Act(elapsedTime); if (act.isReturn) { return; } } } if (content.IsVisible()) { ProcessEvents(); content.UpdateNode(timer.GetMilliseconds()); } if (usePhysics) { if (_dt < 0) { _manager.Step(timer.GetMilliseconds()); } else { _manager.Step(_dt); } } if (follow != null) { if (usePhysics) { _manager.Offset(follow.GetX(), follow.GetY()); } foreach (TileMap tile in tiles) { float offsetX = GetHalfWidth() - follow.GetX(); offsetX = MathUtils.Min(offsetX, 0); offsetX = MathUtils.Max(offsetX, GetWidth() - tile.GetWidth()); float offsetY = GetHalfHeight() - follow.GetY(); offsetY = MathUtils.Min(offsetY, 0); offsetY = MathUtils .Max(offsetY, GetHeight() - tile.GetHeight()); SetOffset(tile, offsetX, offsetY); tile.Update(elapsedTime); } } foreach (SpriteBatchObject o in objects) { if (usePhysics) { PBody body = (PBody)CollectionUtils.Get(_Bodys, o); if (body != null) { PShape shape = body.Inner_shapes()[0]; float rotation = (shape.GetAngle() * MathUtils.RAD_TO_DEG) % 360; AABB aabb = shape.GetAABB(); o.SetLocation(_manager.GetScreenX(aabb.minX), _manager.GetScreenY(aabb.minY)); o.SetRotation(rotation); } } o.Update(elapsedTime); if (updateListener != null) { updateListener.Act(o, elapsedTime); } } Update(elapsedTime); Commits(); }