Thursday, October 29, 2009

Easter Eggs Open Source J2ME Game

Easter Eggs is a little open source J2ME game of mine. It runs on any mobile phone with screen resolution greater than or equal to 176x208. You have to move your bunny left and right and avoid to get hits from the falling stoned eggs that are thrown from a bird. Press the 5 to throw nets and make the bird throw Easter eggs that you must catch to earn points. It is a small game to start examine J2ME source code. Click here to download the Full Netbeans project with the compiled game and the source code

Wednesday, October 28, 2009

SEGA Shinobi for mobile phones



Sega have released a new Shinobi game for mobile phones. The game has been designed for mobile phones with 240x320 screen resolution and it is implemented with the J2ME platform for S60 series. Although it plays at any mobile that supports MIDP 2.0 profile.The game is released only in Japan and China for now but it can be found on the web...


I thing that it is a really cool action game, one of the best i have seen on J2ME and as i read from other web sites it has earned the attention of many gamers. Shinobi seems that still attracts gamers even if they already know the game series from the past or not. I am not surprise about that, every action gamer likes ninjas, surikens, swords and magic. Shinobi games has all of these combined with good graphics and the new mobile version continues the great job.



Tuesday, October 27, 2009

Programming java applet games part 5 - Java 2d Graphics and Graphics2D class

After some days without any updated finally i have found some time to continue my tutorials. The next part is about the Java and 2d graphics. Here i will represent  the Java classes that you will need to implement the Asteroids java applet. First of all i must present you the Graphics2D class. Graphics2D extends the base class Graphics and provide methods to render enhanced graphics. So if this Graphics2D is so strong why it has not replace the standard Graphics class? The answer is simple; it is just for compatibility reasons with the Java 1.1 and previous version that use the standard Graphics class. So if you use this class for your games then they will run only on browsers that support versions of Java greater than 1.1.
Now lets see the first code snippet
public void paint(Graphics g) {
      Graphics2D g2d = (Graphics2D)g;  // make a reference
}
as you can see we just make a Graphics2D reference on the standard Graphics object that jvm passes automatically to paint method. The features that Graphics2D provides are Colors patterns like gradient fills, fill patterns from images, transparency, local fonts access, new Pen styles, 2d affine transformations.
Java provides classes that represent 2d Objects like triangles, ellipses, polygons etc. For out game everything will be represented by this games. The player object will be represented by a triangle, asteroids will be polygons, bullets will be lines. So we will use the classes that Java already implemented for us.

The first class that we will see is the Polygon. You can find full documentation about the class here http://java.sun.com/j2se/1.4.2/docs/api/java/awt/Polygon.html. When you want to create a polygon you just define a Polygon variable and the add points into it.  
Polygon p = new Polygon();
for( int i = 0; i < NUM_OF_POINTS ; i ++ ) {
    p.addPoint( x[i], y[i] );
}

at this snippet of code i assume that there are two arrays x,y that contains the polygon coordinates and a NUM_OF_POINTS int variable with the size of these arrays. To draw this polygon just code
g.draw( p );
or
g.fill( p );
The first one will draw only the outer lines of the polygon will the second will draw a polygons and the inside area.
Ok, for the rendering phase of out game we can use the Polygon class to draw triangle for the user spaceship, polygons for the asteroids and lines for the bullets. What we can do for the update position of our objects?
Java provides classes that implements affine transformations . Ī¤hese transformations are  translate, rotation, scaling, and shearing. With combinations of these transformations we will implement the object movements on the screen. The meanings of translation is to move polygon points to certain coordinates , the  rotations rotates the points , and scaling change the size of the objects. Shearing stretches unevenly the points and will be not used for our game. When we want to move an object make translate transformations onto Graphics2D object and then make the draw for example
g.translate(15.0, 32.0);
g.draw( p );
Thats it for now, play with these classes and in the next tutorial (i hope that it will be soon) i will use these classes into Asteroids game to draw objects and move them.

As allways have nice coding time :-)

Monday, October 26, 2009

Star Wars: The Force Unleashed Ultimate Sith Edition for PC



Soon LucasArts will release a PC version of Star Wars: Force Unleashed the famous best selling action game as the "Ultimate Sith Edition". The new version of the game the original console game with three extra all new missions that continue the storyline of Darth Vader's Secret Apprentice.

Bomber 2 open source j2me game

Bomber 2 is a free open source J2me game that you can download an play at you mobile phone.http://j2mebomber.sourceforge.net/











CodeCup 2010

The CodeCup is a programming contest organized by The Netherlands Informatics Olympiad in  which programmers make computer programs that play games against each other. Everyone that things that has the skills to participate can submit his/her code without any restrictions. There are many games that have been set as contest theme the past years like stratego, scrable clones etc. This year the game is called Amaze and you can find information here http://www.codecup.nl/

If you thing that you have the skills grab your Keyboard and start programming :-)

Sunday, October 25, 2009

Super NES Programming/Initialization Tutorial

Required tools

Assembler directives

If you decide to put the init routine and the header in separate files, it will be necessary to tell the assembler to include them.
.include "header.inc"
.include "Snes_Init.asm"
VBlank:    ; Needed to satisfy interrupt definition in "header.inc"
    RTI
This part can be skipped by putting the header and init code in your main file.

Starting the program

In the header file, the label "Start" is declared as the reset vector, so that is where the program shall begin executing:
Start:

Initializing the SNES

Most demos reset the SNES to a known state. Since emulators probably start in a known state, it may be unnecessary to reset the state for an emulated ROM. Resetting the SNES, however, may be necessary for the demo to run on actual SNES hardware.
To reset the SNES, we set a number of hardware registers to zero and zero all the bytes in WRAM. Here, we use the initialization macro Snes_Init from the file "Snes_Init.asm" from the SNES Devkit, which does this for us:
; Initialize the SNES.
    Snes_Init

Setting the background color

First, we set the accumulator to 8 bits, to modify single bytes of RAM. We do this by setting the appropriate bit in the CPU status register:
sep     #$20        ; Set the A register to 8-bit.

Step 1: Force VBlank

The SNES refreshes its screen to match the signal output to the television, so knowing how the television updates its image can help you understand how certain special effects are performed in the SNES.
A television displays an image on the screen using an electron beam, which it sweeps across the screen from left to right, one horizontal line at a time from top to bottom. Additionally, television images are interlaced, meaning that the television alternates displaying a screenful of all the even-numbered scanlines with a screenful of all the odd-numbered scanlines; each screen of even- or odd-numbered scanlines is called a field. An NTSC television (as used in the U.S. and Japan) displays roughly 30 frames per second, while a PAL television (as used everywhere else) displays 25 frames per second. Thus, an NTSC television displays about 60 fields per second, while a PAL television displays 50 fields per second.
Between lines, when the electron beam is being moved from the right end of one scanline to the left beginning of the next scanline, the electron beam is turned off; this is called the horizontal blank or HBlank. Certain special effects -- like the perspective effects of the Final Fantasy VI airship -- can be performed on the SNES by changing graphics settings during HBlank.
Likewise, between fields, when the electron beam is being moved from the bottom of the screen to the top, the electron beam is turned off; this is called vertical blank or VBlank. If you update the screen while the electron beam is turned on, the results displayed to the user are unpredictable; they may shear or have other artifacts. Therefore, you want to make all your modifications to the screen during HBlank or VBlank. Since VBlank is much longer than HBlank and covers the whole screen, most updates should be done during VBlank. VBlank occurs once per field, or about 60 times per second on NTSC machines and 50 times per second on PAL machines.
There are two ways to ensure that your code executes during a VBlank:
  • Wait for a VBlank non-maskable interrupt (NMI).
  • Turn off the screen by setting the eighth bit of the Screen Display Register ($2100).
Here, we force VBlank by turning off the screen, using the following code:
lda     #%10000000  ; Force VBlank by turning off the screen.
    sta     $2100

Step 2: Setting the Background Color

The SNES stores 16-bit colors in the following format:
  • High byte: 0bbbbbgg
  • Low byte: gggrrrrr
The color that we will use is 00000000 11100000 (0 blue, 7 green, 0 red) -- a dark green. We set the background color of the screen using the Color Data Register ($2122):
lda     #%11100000  ; Load the low byte of the green color.
   sta     $2122
   lda     #000000  ; Load the high byte of the green color.
   sta     $2122

Step 3: Ending VBlank

We end the VBlank by turning the screen back on and setting the brightness to 15, again using the Screen Display Register ($2100):
lda     #001111  ; End VBlank, setting brightness to 15 (100%).
   sta     $2100

Ending the program

Unlike many computer programs, SNES programs aren't really designed to end. SNES games are intended to keep running until the user turns the system off or presses reset. In our case, though, the SNES has done all that we wanted it to do, and now we would like it to sit still and not change anything. We accomplish this with an infinite loop:
; Loop forever.
Forever:
    jmp Forever
If we didn't have this loop at the end, the SNES would start executing any code or data that happened to follow our program, which may make the SNES do something that we didn't intend.
Alternatively, we also could've used the "STP" command. This command stalls the SNES' CPU until the console is reset. The endless loop is a good practice, though, because eventually we'll need a main program loop, and that is what this will become.

Assembling the ROM

Once we have our program in a file -- let's call it "Greenspace.asm" -- we want to assemble it into a ROM image, so that we can run it in an emulator. First, we execute the WLA 65816 assembler to turn the assembly file into an object file:
wla-65816 -vo Greenspace.asm Greenspace.obj
This should create the object file "Greenspace.obj".
Then, we need to link the object file into a ROM. The WLA linker requires a link file that lists the files to be linked. We'll make one called "Greenspace.link" with the following contents:
[objects]
Greenspace.obj 
Then, all we need to do is to execute the WLA linker:
wlalink -vr Greenspace.link Greenspace.smc
This should create the ROM image "Greenspace.smc", which we can then run in an emulator.
To make the compile and link steps easier to run repeatedly -- as we might want to do when alternating between editing and testing -- we can put the commands in a shell script, "Greenspace.bat" in DOS/Windows, or "Greenspace.sh" for UNIX.
wla-65816 -vo Greenspace.asm Greenspace.obj
wlalink -vr Greenspace.link Greenspace.smc
If you use UNIX you need to add #!/bin/bash as the first line of the file. Under Windows, it's a good idea to add @echo off as the first line.

Complete source code

; SNES Initialization Tutorial code
; This code is in the public domain.

.include "Header.inc"
.include "Snes_Init.asm"

; Needed to satisfy interrupt definition in "Header.inc".
VBlank:
  RTI

.bank 0
.section "MainCode"

Start:
    ; Initialize the SNES.
    Snes_Init

    ; Set the background color to green.
    sep     #$20        ; Set the A register to 8-bit.
    lda     #%10000000  ; Force VBlank by turning off the screen.
    sta     $2100
    lda     #%11100000  ; Load the low byte of the green color.
    sta     $2122
    lda     #000000  ; Load the high byte of the green color.
    sta     $2122
    lda     #001111  ; End VBlank, setting brightness to 15 (100%).
    sta     $2100

    ; Loop forever.
Forever:
    jmp Forever

.ends
source
en.wikibooks.org/wiki/Super_NES_Programming/Initialization_Tutorial

Play Ninja Gaiden online

Ok, after the review about Ninja Gaiden Dragon Sword lets remember the old days...

Ninja Gaiden Dragon Sword for Nintendo DS


The last days i have spent some hours to finish the Ninja Gaiden Dragon Sword. I can say for sure that this is one of the best games published for Nintendo DS. A truly outstanding hack n slash game for handheld platforms with unique control , amazing graphics and game-play. I assure you that this game is the the most adaptive game to Nintendo DS capabilities. 
The plot of the game is simple, your character is Ryu Hyabusa a master ninja that need to give battles against evil ninjas, fiends and dragon to rescue his young female apprentice.
The impressive about the game is the way you keep and control the DS. You have to flip the DS sideways and use the stylus to make any movement that you want


In the left screen of DS there is allways a map and at the right there are the characters and you give directions to your hero. For example by pointing on empty areas  you move the character and with simple clicks on non-empty/enemy containing areas you make range attacks like throwing arrows and shurikens. Every move except blocks are activated by stylush movements on the touch screen.
You are (double) jumping with (double) slide up, quick landing with slide down, tapple with sliding while holding block, horizontal slash with horizontal slide, verical slash with slide down etc. There and a super move that is performed by continues diagonal left right sliding of the stylus. There will be times that you will need to use even the microphone to go further into the game story. Yes that's right you will need to make noises to wake up someone :-)



The graphics of the game are very well designed and the cut-scenes combined with the side-view of the console provide you with a feeling that you are reading a comic novel that make the game even more interesting.
The only thing that i would like to had different in this game is the difficulty challenge.  The enemies even the final bosses are easy to be overcome and with the plethora of save points make the mission to accomplish this game an easy job. Off course after you finish the game for one time you can play it again in harder modes.


Your hero fights with a sword (the dragon sword), with range weapons (shuriken and arrows) and with nimpo magic spells. You will gain abilities to throw fireballs, lighting, dark magic, tornadoes,shards of ice and heal yourself.
Ninja Gaiden can connect to network and submit player's skills and compared them with the skills of other players. If you want to buy a game for DS and you have not looked on this then you must. Ninja Gaiden Dragon Sword is the best game that i have played on DS and i guaranty that you will love it.















Tuesday, October 20, 2009

Imagine Cup 2010 contest

The Microsoft imagine Cup contest started and this year and have four categories. General purpose Software development, Game Design, it management and digital video creation. According to Microsoft the purpose of theis contest is to help students to improve the world through technology and it is the seventh year of the contest.
Every year the contest has a different theme context and and for this year is the  
 "Imagine a world where technology helps solve the toughest problems."
The united nations recognise as the touphest problems the

Eradicate extreme hunger and poverty
Overview    Fact sheet    Success stories

Achieve universal primary education
Overview    Fact sheet    Success stories

Promote gender equality and empower women
Overview    Fact sheet    Success stories

Reduce child mortality 
Overview    Fact sheet    Success stories
Improve maternal health
Overview    Fact sheet    Success stories
Combat HIV/AIDS, malaria and other diseases
Overview    Fact sheet    Success stories

Ensure environmental sustainability
Overview    Fact sheet    Success stories
Develop a global partnership for development
Overview    Fact sheet    Success stories



The finals this year will take place at Poland


The Game Design goal is to implement a game with the XNA Game studio or Visual Studio. This is an opportunity for the participants to create an educating game that will provide information about the global problems. Every team that want to apply to the contest must have 1-4 students and on Professor.

So make your team and produce the next winning game :-)

Thursday, October 8, 2009

Play Homebrew applications on Nintendo DSi

For those who do not know what homebrew applications are and they have never used one i must say that they have not seen what a DSI can do. DSI is a magnificent computational machine with many capabilities and must not be limited to licensed games for this console. Nintendo DS Homebrew applications are free software that has been created by independent developers and has not the Nintendo lisence. You can find applications such as these by a simple google search Nintendo DSi homebrew applications. There are thousands of games, with commercial quality that can be downloaded absolutely free. but there are mp3/4 players, internet browsers and many more application  All you need is a flash card and the proper DSI rom. The ligal purpose of these mod cards are to play Hombrew applications but thay can play and lisenced backup roms that can be downloaded from the web. Of course this is completely illegal.
There are many mods i know theEZ FLash Vi, M3i Zero, AceKard 2i, R4I Gold and others. I have the AceKard 2i and the steps that you must do to play homebrew are.


Format a MicroSD card with the the formatter that you can find at http://gbatemp.net/index.php?download=4003
Get the latest version of the AKAIO software from http://gbatemp.net/index.php?download=5069 and put the _aio folder with the akmenu4.nds in the root directory of the MicroSD card
Extract the ak2loader.nds into _aio/loaders
Insert the MicroSD card into your Acekard
Insert the Acekard in your DSi
And play

There is and a video guide on youtube about this

Sunday, October 4, 2009

Iron Man Flight Test

Browser game with Iron man

Marvel Ultimate Alliance 2


marvel_mmo_xbox_360

After the success of the X-men and the Marvel Ultimate Allicance. games all of us we were waiting for the sequel. Marvel Ultimate Alliance 2 has released at 15 September and the PS3 version came to my hands the previous weak so i decided to write a review. The story plot cames from the Marvel Comics  universe and the Marvel Civil War with great storytelling, nice voice work, and superb cut scenes.

There are 24 playable characters in the sequel and include Green Goblin,Venom, Hulk, Blade, Cyclops and many others.The gameplay and the controls are identical to the first Ultimate Alliance and every player that had the experience of it will be 100% familiar with sequel.
Changes come with the addition of new power combinations that you will build up combos to bit up your enemies. The AI of the game is improved and make single player mode much more interesting, with the existence of the up to four players multilayer co-op mode makes a very good game.
Co-op mode you can be plaied locally or online over the PlayStation Network.
The visuals for Marvel Ultimate Alliance 2 are certainly impressive in their own right.The character models design gives them a nice gloss with some very cool little details. It is pretty neat how they tried to add a realistic touch to each of these characters in the game through strong texturing and great animations.
Even if you have plaied the first part of the series even if you not if you like the Marvel Universe then  Marvel Ultimate Allicance 2 will sattisfy you for sure.