⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 impossible.as

📁 Papervision3d的源码
💻 AS
字号:
/**
 * Paperskated3d - simple skateboard simulator in Papervision3d
 * 
 * @author Bartek Drozdz 
 * @version 1.0
 * 
 * Released under Creative Commons Attribution-Non-Commercial-Share Alike 3.0 License.
 */
package com.paperskate3d.tricks {
	
	import com.paperskate3d.skate.SkateBoard;
	import caurina.transitions.Tweener;

	public class Impossible extends BasicTrick {
		
		private var destination:Number = 360;
		private var bendDirection:Number = -90;
		
		public function Impossible(frontFlip:Boolean=false) {
			if (frontFlip) {
				destination = -360;
				bendDirection = 90;
			}
		}
		
		override public function get name():String { return "impossible" };
		
		override protected function prepareTrick():void {
			var kd:Number = TRICK_TIME * .25;
			var kt:Number = TRICK_TIME * .7;
			
			if (olliePhase == Ollie.LEVEL) {
				kd = 0;
				kt *= .85;
			}
			
			Tweener.addTween(this, { 
				flipAmount:destination, 
				bend:Math.PI,
				delay:kd, 
				time:kt, 
				transition:"easeInOutQuad", 
				onComplete:end 
			} );
		}
		
		public function get flipAmount():Number {
			return skateboard.internalRotationX;
		}
		
		public function set flipAmount(a:Number):void {
			skateboard.internalRotationX = a;
		}
		
		public function get bend():Number {
			return skateboard.internalRotationY;
		}
		
		public function set bend(a:Number):void {
			skateboard.rotationZ = Math.sin(a) * bendDirection;
		}

		override protected function finalizeTrick():void {
			skateboard.rotationZ = 0;
			skateboard.internalRotationX = 0;
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -