game programming by j2me
DESCRIPTION
TRANSCRIPT
Game Programming Game Programming by by
J2MEJ2ME
By Hamada Zahera
MUFIX Community © 2010٢
OutlineOutline
•• Java is Everywhere !!Java is Everywhere !!•• Introduction to J2ME: Introduction to J2ME: features & Applicationfeatures & Application•• Your First J2ME Application (Demo#1)Your First J2ME Application (Demo#1)•• Game Design & ArchitectureGame Design & Architecture•• Design your first game (Demo#2)Design your first game (Demo#2)•• Deploying your applicationDeploying your application
MUFIX Community © 2010٣
Java Is Everywhere !Java Is Everywhere !• The Power of Java : it can be used not only for
PC but also many different electronic devices as
MUFIX Community © 2010٤
Java Editions !!Java Editions !!• J2SE (Java 2 standard edition) is for developing
desktop applications, GUI and Database Application (see J2SE API)
• J2EE (Java 2 enterprise edition ) for Client serve applications , for example web sites.
• J2ME (Java 2 micro edition) for applications which run on resource constrained devices (small scale devices) like cell phones, for example games.
MUFIX Community © 2010٥
J2ME: (Java 2 Micro Edition)J2ME: (Java 2 Micro Edition)•• J2MEJ2ME is a java platform which is customized for developing
applications for embedded devices like Mobile , IPhones , PDAs ,….., etc.
MUFIX Community © 2010٦
J2ME ArchitectureJ2ME Architecture• Basically , J2ME Applications run on a platform which
is already support by almost of Mobile phones • By default , there are build-in Packages which support
common functionality like GUI , I/O ,Bluetooth, Game API ,etc . These package called “MIDP”
• Mobile phones are different in hardware configurations and resources like memory and feature
• We have two configuration layer of Embedded Devices : Device with higher resources : set-top Boxes use CDC andDevice with limited resources use CDLC
MUFIX Community © 2010٧
MIDPMIDP- Mobile Information Device Profile (MIDP) is a key
element of J2ME.- When combined with the Connected Limited
Device Configuration (CLDC), MIDP provides a standard Java runtime environment for today's most popular mobile information devices, such as cell phones and PDAs
- We have MIDP 1.0 , MIDP 2.0
Runtime Environment = MIDP+CDLCRuntime Environment = MIDP+CDLC
MUFIX Community © 2010٨
CDCL CDCL vsvs CDCCDCJ2ME Connected, Limited Device Configuration (CLDC)J2ME Connected, Limited Device Configuration (CLDC)- specifies the Java environment for mobile phone, pager and wireless devices - CLDC devices are usually wireless - 160 - 512k of memory available for Java - typically has limited power or battery operated- network connectivity, often wireless, intermittent, low-bandwidth (9600bps or
less)
J2ME Connected Device Configuration (CDC)J2ME Connected Device Configuration (CDC)- describes the Java environment for digital television set-top boxes, high end
wireless devices and automotive telematics systems. - device is powered by a 32-bit processor - 2MB or more of total memory available for Java - network connectivity, often wireless, intermittent, low-bandwidth (9600bps or
less)
MUFIX Community © 2010٩
J2ME FeaturesJ2ME FeaturesDescriptionNameJSR
File system, contacts, calendar, to-do
File Connection and PIM
75
Wireless connectionsBluetooth82
Audio, video, multimedia
Mobile Media API(MMAPI)
135
High level 3D graphics Mobile 3D Graphics
184
GPS Location API179
MUFIX Community © 2010١٠
Demo#1 :Your First applicationDemo#1 :Your First application• Prerequisites :
- JDK 1.5- Install NetBeans with mobility Pack
MUFIX Community © 2010١١
Game DesignGame Design
You have to concern with the following :– Logic – Characters– Graphics– Sounds
MUFIX Community © 2010١٢
Game ElementsGame Elements• 1.Sprite : game object like car , ball ,
persons which has some attributes like X,y coordinates and weight , width
MUFIX Community © 2010١٣
Game Elements .. (cont)Game Elements .. (cont)• 2.Tiled Layers: dividing the game background
into small cells to save memory and allow other spaces for game objects
MUFIX Community © 2010١٤
e.g. Tiling Game Background e.g. Tiling Game Background
MUFIX Community © 2010١٥
Game Elements .. (cont)Game Elements .. (cont)• 3. Layer Manager : it’s a container layer
which group all game object together , game background so we can manage a series of layers simplifying the rendering process
MUFIX Community © 2010١٦
Demo#2 : Game appDemo#2 : Game app
MUFIX Community © 2010١٧
ResourcesResources• Books
• Links:www.j2meforums.comwww.j2meforums.com
MUFIX Community © 2010١٨
Thank you Thank you