Renju, The Game

Posted on March 10, 2008 
Filed Under ActionScript, Flash, Games, PureMVC

RenjuI have been playing this game for a while and thought that it whould be interesting to create my own flash version. For those who don’t know this game, a bit about it - Renju or Lianzhu is the professional variant of Gomoku, a board game originated from Japan in Heian Period. It was named Renju by Japanese journalist Ruikou Kuroiwa in December 6, 1899 in a Japanese newspaper Yorozu chouhou. Lianzhu is a Chinese translation of Renju. It is played with black and white stones on a 15×15 intersection board.

Two players, Black and White, alternately place two stones of their own colour, black and white respectively, on empty intersections of a board, except that Black (the first player) places one stone only for the first move. The one who gets five or more stones in a row (horizontally, vertically or diagonally) first wins the game.

So try it here. You can also download the source. Please note that this game is build on PureMVC version 1.7, and it won’t work under a new version 2.0.1 that has just been released. Just in case, I’ve included older version in source.

Hope you like it, and have fun.

Post Update: March 17, 2008

Implemented difficulty level functionality, some bug fixes and updated code to PureMVC version 2.0.1 . Download source.
For any thoughts about improving this game or bugs, leave comments.

Comments

24 Responses to “Renju, The Game”

  1. MMA Ninja on March 10th, 2008 11:41 pm

    Neat game! Thanks for the source too

  2. Lee on March 17th, 2008 12:08 pm

    I love this. It’s beautiful and smart.

    Is it ready for distribution?

  3. actionscripter on March 17th, 2008 12:27 pm

    Lee,

    I think it is ready.

  4. Lee on March 18th, 2008 10:24 am

    Excellent. After playing 20+ games I still love this. I’m learning how to win, but it still beats me frequently.

    Very impressive AI for a Flash game. And very nice music too.

  5. jmbara on March 19th, 2008 2:19 am

    Very pleasing and polished interface. Played several games and did not find any bugs.
    Well done!

  6. Renju - Flex board game built with the PureMVC framework. at building blocks on March 25th, 2008 9:01 pm

    [...] This is awesome. Here is a polished board game with nice graphics and sounds - full AI - and best of all, the complete source. This is a great example of PureMVC in action. All of the projects on Actionscript Notes utilize PureMVC, and the owner seems to be generous with the source. Many thanks for that. [...]

  7. Najier on March 26th, 2008 2:37 am

    Pretty cool. This is the spirit. A cool application with source included.
    Keep up the good work.

  8. Un bel exemple Flash utilisant le framework PureMVC : Renju on March 26th, 2008 9:32 pm

    [...] viraux! Bon je me rattrape en l’utilisant avec Flex et quand je vois de beaux exemples comme ce jeu japonais Renju, je ne peux qu’encourager les devs Flash à abuser de ce framework (spéciale dédicace à JP [...]

  9. Gobang on March 28th, 2008 4:44 am

    Gobang is originated in ancient China one of the traditional reversi. Gobang modern Japanese call it “liked” Translation “Renju” English as “Gobang” or “FIR” (Five in a Row acronym), there are “even five sons,” and “even five sons.” “beaded”, “five heads”, “Head of touch”, “five grid” and many title.

  10. lordali on April 5th, 2008 9:47 am

    Hi,

    I am trying to learn this game development and wanted to debug and see working in Flex builder 3. Project is not opening in Flex Builder 3. Someone got this project as flex builder 3 project so I just open and compile it without any problems?

    Thanks

  11. actionscripter on April 5th, 2008 10:28 am

    Hi lordali,

    First of all, that’s Flash CS3 project, not Flex. I used Flex Builder to write code and that’s it.
    So to debug/compile/run it, you have to use Flash. There should be Main.fla file in source. Open it, setup API’s paths, publish options, and you’re ready to go.

  12. lordali on April 5th, 2008 10:54 am

    Hi,
    Thanks for the quick reply. I understand.
    One question if you got time to answer. You have setup fla file with grafics, animation etc which is fine than you coded the game in FB3. Now question is

    What if I want to test your code in FB3 than should I create an action script project and import your files in it or How can I open your project in FB3 as it is ready to debug and test. I want to go through each step of your code to see the implementation for learning purpose.

    Help is appreciated thanks

  13. actionscripter on April 5th, 2008 11:23 am

    Yes, you can create an ActionScript Project and import files, it’s good if you want to see the file structure of project and read/write the code, but you won’t be able to compile or debug it in FB3.

    To go through each step, use debugger in Flash ( ctrl+shift+ENTER ). Hope this would help you.

  14. Pi7er on April 10th, 2008 1:15 am

    Very interesting game ,but I found good scheme(bug) to win, when playing at hard difficulty. The explanation is at my site: http://pi7er.ovh.org/renju/index.php

    Also possible to win playing another difficulty with this scheme but it is harder :) because you need to use little changes. Beginning and conception is the same.

  15. actionscripter on April 10th, 2008 5:51 am

    Nice one, but I know even a shorter and simplier way (10 moves). Don’t have time to screenshot it thought.

  16. anon on April 14th, 2008 11:01 pm

    Yeah, pressing that ‘Print Screen’ button is so difficult and time consuming. Should I mention that I invented a cure for cancer? I don’t have time to publish it or share it with anyone though.

  17. actionscripter on April 15th, 2008 6:06 am

    anon,

    nice comparison between cancer and pressing that ‘Print Screen’ button! It’s good that you pay much attention on details, but I think that information about simplier way to beat hard level is not as vital as cancer or anything else. So in my opinion that would be a waste of time on not-so-important thing.

  18. starpause on April 22nd, 2008 9:20 pm

    thanks for the extensive pureMVC implementation example, it’s very educational!

    the only hang up i ran into with the source was a missing font, but it wasn’t hard to google, but here’s the pc font link for convenience:

    http://simplythebest.net/fonts/fonts/japan.html

  19. actionscripter on April 23rd, 2008 9:05 am

    starpause,

    thanks for sharing a link to font, I really did forgot to include it in archive.

  20. Tutorials | PureMVC Roundup « Flash Enabled Blog on July 21st, 2008 11:14 pm

    [...] Renju, The Game [...]

  21. Renju Game Builted on PureMVC | FlexMan on September 24th, 2008 2:29 pm

    [...] Author Home Here [...]

  22. Joel Stransky on December 3rd, 2008 11:36 pm

    Hmm, seems like you should be writing a wrapper for the GoAsap engine.
    http://www.goasap.org/

  23. Newbie on July 19th, 2009 1:44 pm

    awesome… really kool :) and thanks alot for sharing the code…

  24. Alex King on September 6th, 2009 3:51 am

    thanks alot for sharing the code

Leave a Reply