My JavaFX Demo Game: PAC-MAN

UPDATE: June 30, 2009
If you are interested in how to write the Pac-Man game in JavaFX, the source code of this game, please check out this article:

How to Write the Pac-Man Game with JavaFX
or Articles on Writing the JavaFX Pac-Man Game

I spent some time to implement the classic game “PAC MAN”. It demos many features of the JavaFX language. Right now, it is a “simplified” PACMAN Game. I am working on the code and hopefully to complete the PACMAN game soon. Source code is not released yet because I plan to do so when I finish the whole game. A blog of writing this game will be available soon. Stay tuned.

Arrow keys to move and control to pac-man to eat all dots inside the maze. The big dots are magic dots which allow the pac-man to eat ghosts.

JavaFX Features Demostrated:

  • Bindings
  • Animations
  • Effects
  • Transforms
  • Multiple inheritant
  • Java classes integration
  • Declarative statements
  • Sequences, how to map 2D arrays into a 1D Sequence
  • Handling keyboard events

JRE 1.5+ required, JRE1.6 U10 is better, it will take some time for first time launching the game …


My JavaFX code is compatible with the newly released JavaFX 1.0. JavaFX is for Windows and Mac for now. The unofficial JavaFX SDK of Linux can be found here:

If you cannot play now, you can watch the video:

Unrelated links:

JavaFX Articles

Collection: NASCAR Diecast Model Cars

Canadian Citizenship Practice Test

NASCAR Car Diecast

NASCAR Drivers

British Citizenship Test for United Kingdom

Citigroup’s bailout

Last night, the US government rushed to rescue Citigroup and agreed to put billions of dollars into the stricken bank and to plow a whopping $20 billion into it.

Again, Citigroup is “too big” to fail, just like that AIG is “too big” to fail, BoA and lots of other banks, too. And despite the posturing in Congress right now, we can bet the “Big 3” automakers are too big to fail, too. They are going to get a voucher of $30, $60 or even $100 billion soon. In total, about a trillion tax dollars will probably end up in smoke.

However, the government does not even give a damn about our personal investment losses. The meltdown of the markets wiped off our hard-earned money. Who will bail us out? Mr. Obama, do you listen to us?

Safest investment

During the financial crisis, what is the safest investment today?

The answer is probably the Treasury bill(T-bill). This investment instrument is backed by the government. As long as the government remains alive, your T-bill will be paid back with a interest. If the country goes bankrupted, like Iceland, the T-bill will probably be worthless. Recently, a T-bill pays you 1.x% of interest.

The next safest product maybe is the savings bond at 2.x%. A corporate bond usually pays out about 3.x%. A corporate bond has more risk than a Treasury bill. A friend told me that there is an instrument that can get him a 14% annual interest. Though I don’t know what the actual investment is, I am sure this kind of return should be associated with extraordinarily high risk based on the risk/return ratio. So I advice him avoid such kind of investment because we are in a time that cash is the King, or perserve your capital and wait for the right time to invest.

So let’s wait and see…

Best time to invest to where?

We know that the U.S. stock markets won’t come back any time sooner. So where can we put our money to work?

I think China is a candidate that we can put safe money into. China’s growth rate will drop to around 8-9% in 2009, but it is still much higher than the US, which is going towards a recession. So you do not have to be a mathematician to figure out where the big money flows to in the coming few years.

Furthermore, it is seldom known to us that the Chinese banking system is much safer now – with less than 0.1% of the asset exposure to the subprime mess. Chinese banking system is dominated by four big state-owned banks, which can hardly get bankrupted. With more than $1.4 trillion in cash sitting in the banks, there’s no liquidity crisis in China.

Therefore we are sure that the smart money is flooding into China at light speed, with investors cherry-picking world-class Chinese companies for pennies on the dollar.

Based on the above reasoning, I suggest we buy into some Chinese index funds, such as ETFs for a long time gain. To name a few, FXI and PGJ.

Selling a House

A friend of mine is putting a property for sale. Last year, he found his house was worth $820,000. This year, the house was reassessed for only $740,000. He checked the listings around the area the price range from $600,000 to $860,000. So he decided to sell his house for $700,000. My friend wants to cash out the house, but no offer for his listing for 2 months.

He is asking me for advices. As I told him for a few times this year, I do believe the housing market to reverse more than it should. Because it went up much higher than it should have and the correction in price is inevitable. Whatever the house was worth last year is irrelevant now. His property is offered in today’s market conditions. I let him look over what are for sale and what were actually sold. This is all that matters. Go checking out the listings in the same area. Compare them to his house, and after that, relist it below the averaged offering price( for he wants to get out of the property). I am sure in this way it will be sold faster than before.

Building Online Community

Almost every internet user is a member of some sort of an online community.
An online community is usually a public place where people’s internet identity to “gather” virtually and “interact” with each other. Some examples of an online community are bulletin boards, newsletters and photo sharing web sites.

So why are online communities important for marketing purposes? Because it draws many people together so that people can discover new information, share ideas and have fun in it. Though having an online name, people are actually anonymous in a community. This encourage people to speak out something they would not say to someone they know. “Nobody knows who you are and anyone can talk to you” makes it attractive to all.

Why should we make use of online communites to do our marketing? A good approach to start is to find the targeted audience of your web site and locate their community. Take part in the community and find out what people are discussing. This gives you knowledge of the community and allows you to understand what they need. You can build your credibility by interaction with people in the community such as sending posts on a message board or chatting with others. If you have a good reputation in a community, you will find it easy for subsequent marketing events.

Effective Content Marketing
Online Marketing Techniques