sweet link of mini flash games

28 11 2007

I have been a fan of the Orisinal Flash games. Have been visiting it much more lately for the sake of my own game development. Thought I’d post it here and spread the word.

http://www.ferryhalim.com/orisinal/

really like the design look and feel of all the games.





my first MVC game development – dum-de-dum Drum

19 11 2007

Wanted to share the development process of a Flash game utilizing the Model-View-Controller design pattern.

The game is called “dum-de-dum Drum”, which can be found at www.dewmocracy.com starting 11/30/2007. It is the third game in the Forest Chamber (green chamber). It is a 3-level game, each level is similar to a “Simon says” game, with different levels of difficulty.

The very root game class extends a base class, which takes care of the generic screen display/removal, timer, xml loading, show/hide methods, instruction display, game data saving, etc. So what I had to worry about is pure game logic.

I started by analyzing the project from a user experience point of view. The interaction is basically between the user, which is referred to as “USER” below, and the game, being it the model, the view, or the controller, which is referred to as “DRUM” below.

[1] DRUM generates a random sequence (var gameSequ) of drum beats. Go to [2].
[2] DRUM increments the number of beats (var userLength) which it will play. Go to [3].
[3] DRUM indicates the start of playback of the sequence. Go to [4].
[4] DRUM plays the sequence back with (userLength) number of beats. Go to [5]. ([4] and [5] need to be further broken up to a step-to-step process.)
[5] DRUM highlights the drum(s) which were just beaten. Go to [6]. ([4] and [5] need to be further broken up to a step-to-step process.)
[6] DRUM indicates the playback is done and it is the user’s turn to repeat the sequence. Go to [7].
[7] DRUM enables the user interaction. Go to [8].
[8] DRUM waits for user interaction. Whenever USER beats a drum, DRUM records the beat (var userBeat). Go to [9].
[9] DRUM highlights the drum which was just beaten. Go to [10].
[10] DRUM increments where the past beat is located in the current playback sequence (updates both var userBeat and var userBeat). Go to [11].
[11] DRUM checks if the beat generated by the user matches the original beat in the sequence (var userBeat == var gameBeat ?). If yes, go to [12]; if no, go to [16].
[12] DRUM checks if the past beat is the last in the playback (var userBeat == var userLength ?). If yes, go to [13]; if not, go to [8].
[13] DRUM disables user interaction. Go to [14].
[14] DRUM checks if the number of beats played and matched so far is equal to or greater than the length of the original sequence (var userLength >= var gameSequ?). If yes, go to [15]; if no, go to [2].
[15] DRUM indicates USER has won. Go to [17].
[16] DRUM indicates USER has lost. Go to [17].
[17] end of game.

Then I separated the responsibilities of game and assigned them to the Model, the View and the Controller.
[Model]: keeps track of the data, including key variables to keep track of:
.. gameSequ –the entire drum beats collection, gets generated once when the game starts, but cannot be updated ever.
.. userLength –the number of beats in an excerpt of the gameSequ, decides the length of demonstration playback, gets incremented when the user has successfully matched all the beats in the last playback.
.. userBeat –the beat the user just made at the current position in the playback, gets updated every time USER beats a drums.
.. gameBeat –the “correct” beat at the current position in the playback, gets updated every time USER beats a drum.
[View]: displays messages and status of drums (beaten status and normal status), based on changes of the Model.
[Controller]: enable/disable user interaction; updates model based on changes of the Model and/or USER interaction.

Then I translated the above English description to core properties/functions that the classes need to be able to keep track/perform.

[Model]:
.. get gameSequ ():Array
.. set gameSequ (Array)
.. get gameBeat ():int
.. set gameBeat (int)
.. get userBeat ():int
.. set userBeat (int)
.. get userLength ():int
.. set userLength (int)

[View]:
.. playGameSequ ():void
.. playSingleBeat ():void
.. userLengthChangeHandler (Event):void
.. userLengthChangeHandler (Event):void
.. userBeatChangeHandler(Event):void
.. gameBeatChangeHandler(Event):void

[Controller]:
.. beginUserInput ():void
.. endUserInput ():void
.. mouseDownHandler(MouseEvent):void
.. gameEnd (Boolean):void

From this point on it is just coding, debugging and perfecting. I am pretty happy with the final result. Gonna practice this design pattern more with games of larger scales. :)





色戒 李安 –非影评

11 11 2007

过瘾!我过瘾,李安过瘾。实用艺术家们最过瘾的莫过于能够送给自己一份厚礼。李安这次终于做到了。

李安这次终于拍了一部大片送给自己–不再在乎投资来源,不再在乎票房,不再在乎文化的沟通困难,不再在乎语言的障碍,不再在乎历史背景的复杂,李安用高投资,大手笔,给他自己呈现了一部精彩的艺术品。过瘾。

这里不讲情节,李安讲的很清楚了。我只讲我想到的,有关文化,有关电影文化,有关中国文化国际化。

[+] 李安vs.李安。

从《推手》《喜宴》《饮食男女》走到今天的《色戒》,李安踏踏实实教科书般的一步一个脚印的走过来。开始是小成本中国式电影给中国人讲中国人中国文化,到后来的用西方式电影讲西方人西方文化,到中成本中国式电影给西方人讲中国人中国文化,再到大成本西方式电影给西方人讲西方人西方文化,进而用中成本中国式电影给西方人将西方人西方文化,最后这次是大成本中国式电影给全世界人讲中国人中国文化。李安每次都对自己有负责任的交代,不论是文化,艺术,外交,还是商业上的。

[+] 李安vs.成龙。

李安的《the hulk》,打入了西方电影文化的主流,《断背山》则尝试领导了西方电影文化的新潮流,告诉奥斯卡,电影原来也是可以这样拍的,《色戒》更是让西方电影朝着中国的文化翘大拇指–中国人的电影是可以这样精彩的。谈西方电影中的中国文化,不得不谈到成龙。成龙的努力是大家一直看在眼里的,他已经突破了他自己功夫类的表演艺术范畴,制作了几部颇受西方人好评的电影。我清楚的记得我的印度朋友说起成龙的名字时眼中放出的光彩。但是他进好莱坞以后似乎就此原地踏步了,不停的停留在自己的小圈子里,重复的做相似的电影,讲相同的故事。当然,他没有李安的教育背景,也许把他和李安放在一起比较太勉强他了;或许,他并不想让西方观众学会看中国电影,对于他,能够成为西方主流电影文化中的一员已经难能可贵了。

[+] 李安vs.贝聿铭。

到现在为止,中国(Chinese。这里的国界是文化上的,我不在这里谈国界的政治性,更不讨论李安是台湾人还是中国人这个问题–他在文化上无疑是中国人。)建筑界里只有一个人能和李安相提并论,那就是贝聿铭。贝聿铭的最大成功,不在于建筑艺术上的–可以找到一打以上比他对建筑艺术有贡献的当代建筑师–而在于他打入了西方建筑文化的奥斯卡。李安在奥斯卡受到的肯定,无异于巴黎人民对卢浮宫加建如潮的好评。我甚至觉得有了《色戒》,李安高过了贝聿铭。因为贝聿铭在中国的少数几个作品,显然是不能让众人满意的。李安比贝还年轻些,我拭目以待。张永和和马清运都在做出一些世界认可的作品后杀回美国,大有李安之势,但现在下定论,为时尚早。

[+] 李安vs.姜文。

今年的威尼斯电影节,李安姜文同场竞技,李安捧走“金狮”,姜文落败,并非偶然–虽然我丝毫不觉得《太阳》低于《色戒》。姜文导演的电影,以后慢慢讨论,但他去威尼斯也许是走错了地方?我认为李安是电影艺术家,他用完美的电影艺术语言讲文化故事,婉婉道来,一个比一个讲的精彩。不知姜文如何定位自己,但我把他定位成电影思想家,他用电影思考人性,他的三部片子讨论的是同一个问题的不同深度,只是恰好用了电影作为表达语言,与电影的艺术性相关性甚小。我了解的可以与他相提并论的电影人好像不是很多,但是程远作为美术教育家,看了他的电影一定心有戚戚焉。

很久没有用中文写过东西了,脑子的一个部分生锈了,很多想法表达不出,只好浅尝辄止了,以后慢慢来,慢慢来。