Pages

Showing posts with label mobile. Show all posts
Showing posts with label mobile. Show all posts

Thursday, December 9, 2010

How develop your Iphone game?

today I want to  focused on game developing with IPhone.

Best tool for develop IPhone  game is Xcode that you should

run it on mac.For windows and visual studio you can use

mono project and develop iPhone application with it but it is

not good as Xcode .

xcode3.2.3

In Xcode you have many template for building application.

For games you should chose opengles template and

start coding.in following post I’ll describe more about it.

what you need for developing IPhone application?comment it.

Saturday, November 20, 2010

assassin creed 3 brotherhood

assassins_creed_brotherhood_wallpaper_46e9d

new assassin creed series published on  16 novomber

2010  .this game created by ubisoft and Ezio should kill

Cesare with help from his friends (brothers).This game

occurring in ancient roma .assassins-creed-brotherhood-20101116001534486

you can play this game on ps3 and xbox360.In ign its rating

is 8 and in gamespot is 4.5/5 that is good.

also I  play this game on  mobile have nice graphic and can

play it on many mobile .You can find it on gameloft site .

 

Assassins_Creed_27

Monday, November 8, 2010

using keys in your games

images

when you want use keys  you should noticed that have many function

like keyPressed(int keyCode),keyReleased(int keyCode) ,keyRepeated(int keyCode) if you want use all of them should have something for control number of key pressing and releasing and repeating. with this code detect which key is pressed

int gameAction = getGameAction(keyCode);
switch(gameAction){
case UP:
key= "[UP]";
break;
case DOWN:
key= "[DOWN]";
break;
case LEFT:
key= "[LEFT]";
break;
case RIGHT:
key= "[RIGHT]";
break;
case FIRE:
key= "[FIRE]";
break;
case GAME_A:
message = "[LEFT_UP]";
break;
case GAME_B:
message = "[RIGHT_UP]";
break;
case GAME_C:
key= "[LEFT_DOWN]";
break;
case GAME_D:
key= "[RIGHT_DOWN]";
break;
default:
key= "";
break;

you can add all of code in same function.then define value like speed; we assume that in our game when you continue on  key press you have more speed so add this code after detect key “speed++”;But after checking speed in real device you see that you object move slower than emulator.it  because that device can’t process graphic like computer and emulator.You have to use timer functions and class in your games or using smaller graphic file in next post you see how do that


Tuesday, November 2, 2010

developing java touch games

 

iphone-finger-game

In game canvas you can detect keys and touch and using graphic function.Canvas have pre defined functions .For using touch in your game you have three function

protected  void pointerDragged(int x, int y) 
protected  void pointerPressed(int x, int y)
protected  void pointerReleased(int x, int y)

they are active when you dragged or pressed or released your finger(or pen) on your device.X and Y is place of your finger or pen.If you want same action for all of function you can define another function like this

public void doyouraction(int x,int y)
{

//add your code here

// you can change your function name(doyouraction)

}

in other hand you should have deferent code or functions

{} are keyword for define start and end of your codes.Public means that you can use your function in other class ,if you don’t want use private instead.After coding function use it with this codes

protected  void pointerDragged(int x, int y) 

{

doyouraction(int x,int y) ;
}

just this,in next post you’ll see infoo about detect keys and code for them

Thursday, October 28, 2010

about canvas class and using it in mobile game

If you want using keys or touch or graphics in your game you should use canvas class.Canvas class have predefined function for detect key press or drag or screen  touch and also important paint function .First you should add new canvas class with right click on your project and go new and select MIDP canvas…..

In this class you’ll see some function like this

protected  void keyPressed(int keyCode) {
   }
  
   /**
    * Called when a key is released.
    */
   protected  void keyReleased(int keyCode) {
   }

   /**
    * Called when a key is repeated (held down).
    */
   protected  void keyRepeated(int keyCode) {
   }

……………..

……………

…………….

……………

they are contains code that running when key pressed or released or repeated or…you can add code like draw string in keypress and create text when key pressed .Now you should running canvas in your game .For this purpose you should add code like this in startApp function in your middlet.

 Display.getDisplay(this).setCurrent(new MIDPCanvas());

jus thisWinking smile

in next post I’ll describe how you can detect fire,back,numbers,..keys and pointer into your software 

Friday, October 22, 2010

First view of java mobile app code and change it

When you build a java mobile game in software(like netbeans IDE or eclipse..)

first thing you‘ll see is  a middlet class .Middlet class used for handling start and

initialize and interface of java mobile applications. In netbeans you have sample

screen that can add button or text or image or like that .just you should drag your desired items from right side to screen and then go to source

 

netbeansscreen

screen is interface of your project in netbeans

For example you  have pre defined string seeing in screen and want changed it when middlet started. Code is like this

public void startMIDlet() {
       // write pre-action user code here
       switchDisplayable(null, getForm());
             stringItem.setText("my name is dawood");
       // write post-action user code here
   }

startMIDlet is function that using in every middlet .In netbeans for adding interface to screen using a form , should calling when middlet started.For this purpose have this code switchDisplayable(null, getForm());

and then add this for changing text stringItem.setText("my name is dawood");

and run it in emulator

emulator1

in start for do more thing in java games you should add canvas class that i’ll describe later

Saturday, October 16, 2010

about objects in your game(in Android)

  Game contains objects and environment and you should now how coding them.They are defined by class keyword .see this code for example

package com.example.helloandroid;

import android.app.Activity;

import android.os.Bundle;

import android.widget.TextView;

public class HelloAndroid extends Activity

{

/** Called when the activity is first created.

*/ @Override

  public void onCreate(Bundle savedInstanceState)

  {

  super.onCreate(savedInstanceState);

TextView tv =  new TextView (this)tv.setText("Hello, Android"); setContentView (tv);

}

}

this is sample code for showing hello word in android( get from here)

Package contains you project content.For running your project in ide you should add required codes.Import keyword using for add this code.Public means that your object is visible to project or package.helloAndroid is your main project(environment) and onCreate is function of objects that used to create a text in device(i’ll describe code later,see source for some help for now).Your code can be changed on base of your algorithm. Your algorithm can be like this :

1.add codes for running games

2.create  HelloAndroid environment(project)

3.set text “hello, Android”

4.show them

Now you can add a line to algorithm “set text when you clicked on 5” and change code also.For now is sufficient ,I’ll describe more in following posts.For coding using eclipse and adt plugin and android sdk  and run your project and see result like this

hello_world_5

Friday, October 1, 2010

load 3d models in your java games(part 2)

        Now you should design your models .Main format using for java games is m3g file.Software that you using for design should be export your models to m3g .When you using even good software like 3ds max 2010 it is possible that lose some  graphics in  your models because m3g formats reduce 3d models size and graphics for better working in mobile device.

Blender

Blender is free 3d design tools for making animation and your models.For start you can use this tools for export your models into m3g

and see result in m3g viewer  if you don’t want pay more for software like that.Blender need python  installed in your computer 

blender

for seeing your result in  viewer  you can use tools like this from MascotCapsule .This tools also  have exporter  for h3t and convertor for change  h3t to m3g formats. and have better result from normal m3g exporter but h3t exporter plugins used only in 3ds max and maya. 3ds max and maya  have better result than blender but aren’t free .With 3ds max and maya you can design high graphics models and then reduce polygons and export it to m3g.

 

3dsmax2010

Friday, September 24, 2010

load 3d models into your game (part1)

Second step in  create mobile game is that create your environment.you can design your environment by 2d pictures  with sample paint game or
3573394595_925599a400
3d worlds with  best 3d  software. First you should know which game you want to build .  For  more games you should use 2d pictures and 3d worlds both.So if you want make sample games limit number of pictures and  3d worlds  and objects .Add them more time  into your game and change place of pictures  and objects and create new levels or increase them.
Shadow of Legend
for more complicated  and high graphic game  You should add 3d objects
and textured them into game.Add textured objects  forced to limit you in create levels and nice place(I’ll describe using texture and objects in following posts) and some  mobile  even have some crash in loading your objects.Textures that you used in games should be at last 64*64 or 128*128 .More higher pictures  can’t be loading in many mobiles and tools.But for background images you should now mobiles resolution or  using some important resolution.Change size of background image into game maybe disturb your image and you should accept risk of it.
TombRaiderLegend_lrg

Thursday, September 16, 2010

Which tools you use for create mobile games?

 

        Ok first you should know tools that used .  There is so many tools you can use for create mobile   games.But three of them are most important than others.Everyone have some profit and loose to others  and on base of your needs can use one of them.

1.NETBEANS

netbeans691

Netbeans is oracle tool for java programming(windows and mobile and..).Oracle bought  java and Netbeans from sun company .Netbeans

have visual library.It means that for create some tools like web tool and windows form you can drag library like button and forms and textbox and..to your program without code.But It can’t use for some mobile 3d games.

2.Eclipse

Eclipse is ibm tool for for java programming.Andriod officially support eclipse(not netbeans because oracle and google problem).Netbeans have also plugin for android but isn’t officially supported.Eclipse ide have also better plugin support from netbeans.

eclipse

 

 

3.microsot visual studio(express have no mobile support)

Best to for windows mobile programming but no java mobile support

visualstudio

now ready for programming!

linkwithin

Related Posts Plugin for WordPress, Blogger...