Friday, 17 April 2015

Flash coding

Coding in Adobe Flash


This is the first iteration of coding which will be used for character to move. This is all a new experience for me since I am not knowledgeable at coding + I had absolutely no idea how to even move characters in isometric way. There wasn't much of a choice for me except moving character by mouse clicking.

Later on, these are few of the major coding which have been used to create this interactive piece.

//Variables
var targetPos:Point;
var charSpeed : Number = 7;
var clickedPickup : Boolean = false;
var clickedPickupName : String = "";
var onArrivedAtPickupFunction:Function = null;
var soundChannel : SoundChannel = new SoundChannel();
var soundClip : Sound = new bkgmus();
var currScene :int  = 1;
soundChannel = soundClip.play(0,99999);

stop();

SetupScene();

function SetupScene()
{
HideMsg(null);
SetupTransitionButton();
SetupClickingOnPickup();
SetupCharacterMovement();
FindAllPickups();

}

Variables for every single objects and functions for each scenes. This was rather challenging but with few helps in the internet and other people's opinions, I have been able to finish coding without any errors.

No comments:

Post a Comment