Screenshot

Next tutorial? The s9 G-Sensor

2nd, Apr 2009 in Announcements Written by santoki 3 Comments

G-Sensor?

A few days ago I received my new cowon s9 – I simply love it. I have been for a while now using a friends, but now that I have my own it’s time to develop apps and games like no tomorrow! :)

However, before I get going, I want other developers or even new developers to get there feets wet with some of Cowon s9’s special fscommand features. My last post was on the saving capabilities and I hope many of you have benefited from that, but I plan to write up a tutorial on the g-sensor feature available on the cowon s9 within a few days.

The G-sensor on the s9 unfortunately is not as powerful as many hope. It is limited to only 4 degrees 0,90,180,270. However, by fooling the s9 of a gravitational pseudo “physics.” I believe we can make the g sensor just as good as any competing mobile market. My hopes is to create a rough API that developers can use to optimize it for their games.

Until then, It’s time to listen to some good music on the s9~

cheers,

Santoki

Screenshot

Tutorial: Saving data in flash.

22nd, Mar 2009 in Tutorials Written by santoki 1 Comment

tutorial

In this tutorial you will learn how to save data in flash through a small touch tag game for the Cowon s9. I will assume throughout the tutorial that you know the basics of flash. If not, there are plenty of flash tutorial sites available with a simple search. I will be using Flash Professional CS3 so there will be some minor graphical difference, but the concept will be the same as well as the code.

If you only need to see the example source file, then you can download it here.

Otherwise, you can follow along through this tutorial and begin creating a game that utilizes Shared Objects – the means to save data with your Cowon s9.

Prerequisites

You will need a Flash IDE program that is able to author Actionscript 2.0 Any Flash IDE from Flash MX and above will work. You can purchase or try the latest version of flash CS4 here.

The Setup

1. Create a new flash document with AS 2.0 and change the size to 480 x 272.

Note: It is crucial that you open the flash document in AS2.0 because the Cowon s9 will not be able to read AS3.0 flash files and AS1.0 will not be able to save data.

2. We will also need to set the FPS (Frames per second) to 24.

The Properties

3. On “Layer 1″, relabel it to “actions” and lock the layer.

4. Create three additional layers and label them accordingly: frame label (locked), text, object.

Note: While not crucial to lock the frame label and/or the actions layer it is a good programming habit.

4 layers

5. We will need 4 frames total to cover for the following games states: initialization, main menu, play game state, end state.

6. Name the last frame of the frame label layer with “gameover” and the third frame with “game”

We are done setting up the scene. If you are lost, or would like to start with the file I have created so far you can download it here.


The Objects.

The next portion will focus on the objects you will be interacting with.

7. On the second frame of the Object Layer, add a button. You can do this manually, or you can add a common library button.

Windows >> Common Libraries >> Buttons

8. Add a dynamic text field on the Text Layer with a variable name of “highscore”

9. Add any text or decoration you feel fitting for a title/menu screen.

pic3

9. On the the third frame in the Object Layer, Create a circle with Oval Tool with size of 100 x 100 and place it somewhere on the canvas.

10. Convert the circle you have just made to a Movie Clip instance by

Double Click on it to select it
Press F8 and choose “Movie Clip” under Behavior radio button
Click OK

11. Give the new Movie Clip the instance name of “ball”

pic4

12. Create three new dynamic text on the Text Layer with the variable names of “timer”, “score”, “highscore”. Place them where you want them listed. Remember to add static texts to label what each dynamic text represents.

pic5

13. Lastly, on the last frame ( the game over screen) of the Object Layer, add another button.

14. Add one last dynamic text labeled “score”.

15. Finish the Game Over screen by decorating it to your will.

pic6

We are done setting up the visual scene. If you are lost, or would like to start with the file I have created so far you can download it here.

The Code.

This is what allows flash to save data.

16. Open up the Actions window by pressing F9 on the “actions” layer of the first frame and insert the following code:

    score_record = SharedObject.getLocal(“name_of_file”);

    if (score_record.data.highscore == undefined){

highscore = 0;

    } else {

highscore = score_record.data.highscore;

    }

5. Let’s see what this does:

score_record = SharedObject.getLocal(“name_of_file”);

// Replace “name_of_file” to the filename you choose for the Shared Object.

// The variable “score_record” is the name for the data stored.

highscore = 0;

// if no highscore has been defined, it will be initialized to 0.

highscore = score_record.data.highscore;

// if a highscore has been defined, it will be set to the saved highscore.

16. On the second frame insert the following code:

stop();
var score:Number = 0;
var initial_timer:Number = 120;
var timer:Number = initial_timer;

17. Let’s see what this does:

var score:Number = 0;
// The score is initially set to 0.

var initial_timer:Number = 120;
// We set the initial timer to 10 seconds.
// In this example we have 120 because we have 24 fps. eg: 24 fps * 5 sec = 120.

var timer:Number = initial_timer;
// We then set the timer to the initial timer.

18. On the third frame insert the following code:

stop();
onEnterFrame = function(){

_root.timer-=1;
if (score > highscore){

highscore = score;

}

if(timer < 0 ){

gotoAndStop(“gameover”);

}

}

ball.onLoad = function(){

this._x = random(480-this._width)+this._width/2;
this._y = random(272-this._height)+this._height/2;

}

ball.onPress = function(){

_root.score+=1;
_root.timer += 5;
this._x = random(480-this._width)+this._width/2;
this._y = random(272-this._height)+this._height/2;

}

19. Add the following code to the button on the Object Layer :

on(release){
_root.gotoAndPlay(“game”);

}

20. Let’s see what this does:

// onEnterFrame is our main loop
onEnterFrame = function(){

// The variable timer looses one every loop.
_root.timer-=1;

// If the player reaches a score that is greater than the current highscore,
// the highscore will be replaced with the current score.
if (score > highscore){

highscore = score;

}

// If the timer is less than 0 the game will end to the “gameover” framelabel.
if(timer < 0 ){

gotoAndStop(“gameover”);

}

}

ball.onLoad = function(){

/*
To randomize the ball’s next location we have this code:
We first randomize the value of the screen size minus the ball’s height.
We then add it’s radius to create a offset from the center.
The same principal is done for the height.
*/

this._x = random(480-this._width)+this._width/2;
this._y = random(272-this._height)+this._height/2;

}

// This function activates whenever the ball movieclip is pressed.
ball.onPress = function(){

// score is incremented by one for every successful click.
_root.score+=1;

// A bonus time of 5 is given for a successful press.
_root.timer += 5;
/*
To randomize the ball’s next location we have this code:
We first randomize the value of the screen size minus the ball’s height.
We then add it’s radius to create a offset from the center.
The same principal is done for the height.
*/
this._x = random(480-this._width)+this._width/2;
this._y = random(272-this._height)+this._height/2;

}

21. On the fourth frame insert the following code:

stop();
if (score>=highscore) {

score_record.data.highscore = score;
score_record.flush();

}

22. Let’s see what this does:

// A record is set!
if (score>=highscore) {

// We now set the score to the highscore variable.
score_record.data.highscore = score;
// The score is saved to the Shared Object.
score_record.flush();

}

23. Finally add the following code to the button on the Object Layer.

on(release){
_root.score = 0;
_root.timer = _root.initial_timer;
_root.gotoAndPlay(“game”);
}

24. Believe it or not, you are finished. If you did everything right, after testing your movie (ctrl+Enter) you should be able to save your new game. If you are lost, or would like to start with the file I have created so far you can download it here.

If you have any questions, thoughts, suggestions and/or comments, feel free to post them here. If there is an error in my post feel free to point them out as well.

Screenshot

Shadow Kai’s design phase.

28th, Feb 2009 in Shadow Kai Written by santoki 5 Comments

dialogues within game

Greetings! Well Shadow Kai has been finally ressurected on board after a few weeks of hiatus due to issues with the computer. Well we are currently working on the archer’s art as well as a few mechanics related to the bowman. Currently the game allows the character for 4 options on the player’s turn phase: attack, defend, skill, move.

All character’s currently have a damage based attack and a special skill specific to its class.

For instance, the warrior has a basic attack, but can initiate its “berserk mode” which elevates its damage output in exchange for lowering his defenses. The archer on the other hand has a ranged attack, but can utilize it’s arrow shower ability which rains an area of effect damage on a portion of land.

With these unique skills, it will require an immense effort of balance and time. So our team is trying our best to push up a beta to test between the two character classes – let’s hope sometime in March.

I think I’ll be making a few tutorials in the coming weeks – what do you guys think?

Screenshot

the great leap

31st, Jan 2009 in Mobile Flash Games Written by santoki No Comments
It's time to start running!

It's time to start running!

The successor to the jam packed jump series has finally arrived – The Great Leap! Although there are no “obstacles” to jump over, the game still requires you to jump once at the end. However, to score high, one must build just enough momentum by pressing the left and right key alternatively before the momentum bar runs out. To score a high jump, one must dash as fast as they can and pressing the <up> key just before the momentum bar finishes. The runner will then commence a powerful leap to victory.

The scoring value is based on an algorithm that takes account of the user’s total alternative left and right presses with the final momentum bar as a final multiplier.

The final leap of faith!

The final leap of faith!

This game is being currently ported to other mobile device dimensions for optimal play and will soon be uploaded to playyoo.com.

Santoki

Screenshot

Poll: What kind of setting should the tactics game be in?

19th, Jan 2009 in Announcements, Shadow Kai Written by santoki No Comments

tactics code

The current engine I’m running for this new upcoming tactics game has been built with “flexibility” in mind. Therefore, the animation has almost no effect on the actual coding. This means that I can replace a single animation and not worry about it affecting the code. Because of this, I really want to give you, the audience, the ability to choose which setting this tactics game engine will take place in. As of now, it is set to the mythological ancient Asian era. I’ve listed a few ideas I currently have as a developer, but feel free to give your input as well!

Ancient Asian Era

Ancient Asian Era

In this setting, the main playable characters will be: warriors, bandits, mages, clerics, alchemists, bowmen, etc. Special skills will invoke skills such as: a shower of arrows, a bombardment of rockets, summoning an area of effect dragon, etc.

Space Warfare

Space Battles

In this setting, the main playable characters will be: interceptors, bombers, mother ships, destroyers, cruisers, etc. Special skills will invoke skills such as: self destruct, force field, recall, reinforcements, bombard, etc.

Robotic Battles

Robotic Battlegrounds

In this setting, the main playable characters will be: technicians, reapers, scouts, enforcers, eradicators, commander, etc. Special skills will invoke skills such as: heat missiles, EMP shock waves, Ion cannons, nukes, etc.

A few things to note before voting:

I will have the final opinion so please don’t abuse the polling. I have set the polling so that anyone can vote.

[poll id="3"]

Screenshot

Shadow Kai in production

14th, Jan 2009 in Announcements, Shadow Kai Written by santoki No Comments

shadowkai

After several weeks of planing and concept sketching, I’ve started making my effort into pushing one of the biggest game I’ve ever imagined – Shadow Kai. In comparison,  Sketchlite, although not finished, has taken me several months to push itself from the drawing board into a playable game. I think Shadow Kai will end up being a similar process.

What brought Shadow Kai literally from the shadows (no pun intended) was the fact that the Cowon s9 was a touch based interface. I’ve always wanted Shadow Kai to have some sort of a coordinate based maneuver and with the Cowon s9 it seemed possible.

Currently, my plans for the battle mode will run along the lines of a complex real time strategy board game. There will be heroes, bowmen, warriors, clerics, alchemists, mages, and other gifted classes. In the current build there are four options for a selected unit: an attack, movement, wait, and special.

For instance, a warrior is able to move in a circular boundary limited to its movement range. Once moved the unit is able to redo its movement phase by click the undo button. The unit may also do one of the following action buttons: attack, special, or wait. If any of the action buttons have been pressed the undo move button no longer undoes a movement.

The special button is unique to ever class and even subclasses. In the current build, warriors will be able to use a berserk mode (special) which will allow them to increase their attack at the cost of lowering their defense which will last for 3 turns, leading to a special button cool down of 5 turns.

In terms of design, each character class will be designed in 3D and imported to flash for each cases and phases. This will be one of the many hindrances to the project due to time and perfection, but in the end will most likely be enjoyable aesthetically.

I’ve uploaded a few demonstrations and images for you all to see. Enjoy!

Pictures:

three warriors

4 options

Video:

Screenshot

fresh start

11th, Jan 2009 in Announcements Written by santoki No Comments

I’ve migrated over to a new wordpress, but that shouldn’t stop me from making more games. In fact, I recently bought a Cowon s9 and I’m totally enamored by it. I’ve already made several pre-staged games for it and it seems so far that it will be a great platform.

Sorry again for the domain name change. If any of you are in a major forum site, if you could ask your forum moderators to change any 2souldesign links to this site that would be great and most appreciated!

This site will probably go through many changes, but it should all settle after a few months.

santoki