Reputation: 59
I'm making a Patatap clone, and trying to make different shapes and different animations on each key.
I've figured how to assign different shapes on onKeyDown
function, but I'm stuck at onFrame
function to give different animations on each shape.
I tried to check the array of shapes to find out the difference, but since it has tons of lines, I was not able to.
//Just short dummy code to roughly show how I did
function onKeyDown(event){
if(type === 'rectangle'){
var shape = new Path.Rectangle
}else if(type === 'circle'){
var shape = new Path.Circle
}
}
... this works
function onFrame(event){
shape.fillColor.hue += 1; //this works
//I want to do this
//shape.type is just a made up variable
if(shape.type === 'rectangle'){
shape.rotate(5);
}else if(shape.type === 'circle'){
shape.scale(0.95);
}
Thanks for any help
Upvotes: 0
Views: 51