root/Deprecated/player.as

User picture

Author: Ying

Revision: 7 («Previous)


File Size: 1.15 KB

(March 01, 2009 21:15 UTC) About 3 years ago

Ying:
- Medio funciona
- He cambiado a AS3

 
Show/hide line numbers

// dirFlag is always changing with CallInput()
// movFlag CAN ONLY be modified by dirFlag if it equals 0;
// when movFlag!=0, Movement() is sucesively called with movFlag's value
// only when player hits a wall, StopMovement() is called and movFlag=0;


// Movement can actually move the movieclip, or it can just do some calculus in the matrix



class player extends MovieClip {

	#include "input.as"



	// ------------------ variables ------------------
	var dirFlag;
	// tells the input
	// enough cos it can only move 1 direction at a time:
	// 4-2-6-8 == l-d-r-u
	var movFlag;
	// tells where the movieclip is moving
	// 0 if it isnt moving



	// ------------------ movement ------------------
	function Movement() {
		// this actually moves or does it do some matrix cool stuff?
	}

	function StopMovement() {
		// dont call this until player has collided with wall or end
		movFlag = 0;
	}



	// ------------------ important ------------------
	function onEnterFrame() {
		dirFlag = CallInput();
		// lotsa stuff there
		_root.dirflagtext.text = "input: "+dirFlag;
		_root.movflagtext.text = "movem: "+movFlag;
	}

}