Skip to content

Commit

Permalink
arrow animation loop and tile animation
Browse files Browse the repository at this point in the history
  • Loading branch information
johnchoi313 committed Sep 29, 2023
1 parent 32a1494 commit 4328f20
Showing 1 changed file with 34 additions and 2 deletions.
36 changes: 34 additions & 2 deletions examples/chess/chess.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,21 @@ def CreateTile(self):
)
self.scene.add_object(self.tile)

#self.AnimateTile()

def AnimateTile(self):
self.tile.dispatch_animation(
[
Animation(
property="scale",
start=Scale(1.1, 1.1, 1.1),
end=Scale(1,1,1),
easing="easeOutCubic",
dur=300
)
]
)
self.scene.run_animations(self.tile)


def AnimatePieceStart(self,fromX,fromY):
Expand Down Expand Up @@ -269,7 +284,7 @@ def CreateDeadPiece(self, team, type):
Animation(
property="scale",
start=(0.2,0.2,0.2),
end=(0.05,0.05,0.05),
end=(0.0,0.0,0.0), #(.05,.05,.05)
easing="linear",
dur=600,
delay=2000
Expand Down Expand Up @@ -394,6 +409,7 @@ def DeletePointerCylinders(self):

def CreatePointer(self, x, y):
tile = self.board[x][y].tile
self.board[x][y].AnimateTile()

self.pointer = Cone(
object_id=HEADER+"_Pointer",
Expand All @@ -402,12 +418,28 @@ def CreatePointer(self, x, y):
scale=Scale(.1,.15,.1),
position=Position(0,1.3,0),
rotation=Rotation(180,0,0),

parent = tile,
persist=True
)
self.scene.add_object(self.pointer)

self.pointer.dispatch_animation(
[
Animation(
property="position",
start=(0,1.25,0),
end=(0,1.35,0),
dir="normal",
easing="easeInOutElastic",
loop=True,
dur=500
)
]
)
self.scene.run_animations(self.pointer)




def CreateSelection(self, x, y):
Expand Down

0 comments on commit 4328f20

Please sign in to comment.