Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- switch (GetMoleState())
- {
- case MoleStates.up:
- case MoleStates.movingUp:
- // grejer hรคr
- break;
- case MoleStates.up:
- currentTimer += Time.DeltaTime * 0.001f;
- if (currentTimer > upTime) SetMoleState(MoleStates.movingDown);
- break;
- case MoleStates.movingUp:
- Position += new Vector2(0, -1f * Time.DeltaTime);
- if (Position.Y <= upPos.Y) SetMoleState(MoleStates.up);
- break;
- case MoleStates.down:
- currentTimer += Time.DeltaTime * 0.001f;
- if (currentTimer > downTime) SetMoleState(MoleStates.movingUp);
- break;
- case MoleStates.movingDown:
- Position += new Vector2(0, 0.5f * Time.DeltaTime);
- if (Position.Y >= downPos.Y) SetMoleState(MoleStates.down);
- break;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement