Friday, December 25, 2015

#ScreenshotSaturday #Coding #ActionScript ---- Developer's Journal ---- My Very Old Game....



I found out this old and dusty game as I cleaned up my hard drive yesterday. It was written in ActionScript (for Flash) when I was a student of Multimedia of IT. Basically you just need to ‘’kill’’ those hearts with a tiny arrow, and computer will record your score, etc. Creating this game was such a fun experience, yet the game is not bug-free --- after re-examining my very first game.  

The major data types I used in this game include, String, Number, Array, int, LoadVars, Function, EventListener, etc. There is a countdown timer event to be used in this game, and the getRandom/Math.floor(Math.random()) to generate a pseudo-random number.

“If…else” conditional statement is also used in this ActionScript game (with those brackets), i.e:



function clickHandler2(event:MouseEvent):void{
        if(highest>5){
        gotoAndStop(4); //frame by frame
        }else{
                 //create a popup window if the highest number <5 font="">
               this.addChild(popup01); //display the popup window
                this.popup01.x=100; //set the x coordinate of the popup
                this.popup01.y=150; //set the y coordinate of the popup
        }
}



But I think Python is indeed a much cleaner programming language, at least we don’t need to deal with those little brackets here --- Readability Counts.

When I have time, I might debug and clean up my old ActionScript codes used in this little game (total 5 frames), and post here for reference.


Merry Christmas!





No comments:

Post a Comment