<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-34656208</id><updated>2011-12-14T19:02:43.721-08:00</updated><title type='text'>J2ME / Game Programming Codes</title><subtitle type='html'>J2ME game programming codes that I have documented while studying J2ME game development</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://sonusdream.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34656208/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://sonusdream.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Rey Jexter Bumalay</name><uri>http://www.blogger.com/profile/18369902492426908546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_rOrq2e7BqFI/R6sjJFXcMMI/AAAAAAAAAAQ/P75_PXRzsYY/S220/DSC01363.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>10</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-34656208.post-116978663256917535</id><published>2007-01-25T20:24:00.000-08:00</published><updated>2007-01-25T20:47:31.356-08:00</updated><title type='text'>'Casual Game' game engine source code</title><content type='html'>Its been a while since i last posted an article.  I'm quite busy working on my first game..&lt;br /&gt;&lt;br /&gt;Anyway did you remember the game like bejeweled and other casual games wherein you match objects of the same type, color and etc..?&lt;br /&gt;&lt;br /&gt;The past 2 weeks i've been working on 2 different types of game engine. The first is a game engine for tile based games and the second is a game engine for a casual game. This game engine still needs a lot of work but the idea on how to create this kind of things is already finished.&lt;br /&gt;&lt;br /&gt;Some screenshots:&lt;br /&gt;&lt;br /&gt;&lt;img src="http://i111.photobucket.com/albums/n129/reyjexter/casualengine/screen2.jpg" /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;[screenshot 1]&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="http://i111.photobucket.com/albums/n129/reyjexter/casualengine/screen2.jpg" /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;[screenshot 2]&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;You can download the whole source code &lt;a href="http://files-upload.com/files/76713/CasualGame.zip.html"&gt;here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Note that you will wait for a couple of seconds before the download starts.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34656208-116978663256917535?l=sonusdream.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sonusdream.blogspot.com/feeds/116978663256917535/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34656208&amp;postID=116978663256917535' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34656208/posts/default/116978663256917535'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34656208/posts/default/116978663256917535'/><link rel='alternate' type='text/html' href='http://sonusdream.blogspot.com/2007/01/casual-game-game-engine-source-code.html' title='&apos;Casual Game&apos; game engine source code'/><author><name>Rey Jexter Bumalay</name><uri>http://www.blogger.com/profile/18369902492426908546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_rOrq2e7BqFI/R6sjJFXcMMI/AAAAAAAAAAQ/P75_PXRzsYY/S220/DSC01363.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://i111.photobucket.com/albums/n129/reyjexter/casualengine/th_screen2.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34656208.post-116297816122582663</id><published>2006-11-08T01:24:00.000-08:00</published><updated>2006-11-08T01:47:22.726-08:00</updated><title type='text'>Scrolling Pane / Scrolling Canvas</title><content type='html'>This is an example on how to create a scrolling pane or a scrolling canvas. I dont have time to explain this but the code is really easy. You can download the whole project including the ScrollingPane class &lt;a href="http://www.4shared.com/file/5622159/7a294ea0/scrolling_pane.html"&gt;here &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Some screenshots:&lt;br /&gt;&lt;br /&gt;&lt;img src="http://i111.photobucket.com/albums/n129/reyjexter/scrolling-pane/scrolling_pane_3.jpg" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="http://i111.photobucket.com/albums/n129/reyjexter/scrolling-pane/scrolling_pane_2.jpg" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="http://i111.photobucket.com/albums/n129/reyjexter/scrolling-pane/scrolling_pane_1.jpg" /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34656208-116297816122582663?l=sonusdream.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sonusdream.blogspot.com/feeds/116297816122582663/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34656208&amp;postID=116297816122582663' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34656208/posts/default/116297816122582663'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34656208/posts/default/116297816122582663'/><link rel='alternate' type='text/html' href='http://sonusdream.blogspot.com/2006/11/scrolling-pane-scrolling-canvas.html' title='Scrolling Pane / Scrolling Canvas'/><author><name>Rey Jexter Bumalay</name><uri>http://www.blogger.com/profile/18369902492426908546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_rOrq2e7BqFI/R6sjJFXcMMI/AAAAAAAAAAQ/P75_PXRzsYY/S220/DSC01363.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://i111.photobucket.com/albums/n129/reyjexter/scrolling-pane/th_scrolling_pane_3.jpg' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34656208.post-116189576702611085</id><published>2006-10-26T13:45:00.000-07:00</published><updated>2006-10-26T13:52:45.306-07:00</updated><title type='text'>bitmap font creator, fnt to j2me converter and sample source code</title><content type='html'>This is a really nice tool so you can easily create bitmap fonts from a true type fonts.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.j2meblog.de/tools/JFont.zip"&gt;Sample code and fnt to j2me converter&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.angelcode.com/products/bmfont/"&gt;BMFont - bitmap font coverter official site&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I have'nt tried this yet but from the comments i read, this will surely work. It also have a word wrap functionality.&lt;br /&gt;&lt;br /&gt;btw, you may need to wait really really long if you try to convert .fnt file to j2me using the converter.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34656208-116189576702611085?l=sonusdream.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sonusdream.blogspot.com/feeds/116189576702611085/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34656208&amp;postID=116189576702611085' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34656208/posts/default/116189576702611085'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34656208/posts/default/116189576702611085'/><link rel='alternate' type='text/html' href='http://sonusdream.blogspot.com/2006/10/bitmap-font-creator-fnt-to-j2me.html' title='bitmap font creator, fnt to j2me converter and sample source code'/><author><name>Rey Jexter Bumalay</name><uri>http://www.blogger.com/profile/18369902492426908546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_rOrq2e7BqFI/R6sjJFXcMMI/AAAAAAAAAAQ/P75_PXRzsYY/S220/DSC01363.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34656208.post-116146154382669682</id><published>2006-10-21T13:05:00.000-07:00</published><updated>2006-10-21T13:15:32.313-07:00</updated><title type='text'>File naming convention in Symbian OS is case sensitive !!!</title><content type='html'>Keep in mind that file naming in Symbian OS is case sensitive. For example you have a file named "myimage.PNG". Take a look at the following code:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;Image img = Image.createImage("myimage.png");&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;On your emulator, the file will be loaded since windows file naming convention is not case sensitive. But if you try to run the MIDlet on your phone, the application will immediatly close after you try to run it.&lt;br /&gt;&lt;br /&gt;I have experienced this problem and it took me a while to solve it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34656208-116146154382669682?l=sonusdream.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sonusdream.blogspot.com/feeds/116146154382669682/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34656208&amp;postID=116146154382669682' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34656208/posts/default/116146154382669682'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34656208/posts/default/116146154382669682'/><link rel='alternate' type='text/html' href='http://sonusdream.blogspot.com/2006/10/file-naming-convention-in-symbian-os.html' title='File naming convention in Symbian OS is case sensitive !!!'/><author><name>Rey Jexter Bumalay</name><uri>http://www.blogger.com/profile/18369902492426908546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_rOrq2e7BqFI/R6sjJFXcMMI/AAAAAAAAAAQ/P75_PXRzsYY/S220/DSC01363.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34656208.post-116061982441316608</id><published>2006-10-11T19:17:00.000-07:00</published><updated>2006-10-11T19:25:33.873-07:00</updated><title type='text'>setFullscreen() not working on phone</title><content type='html'>Have you ever experienced a problem where your MIDlet seems to be in fullscreen mode on your emulator but on your actual device the image is only about 3/4 of your screen is used? You can check the following sites:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://discussion.forum.nokia.com/forum/showthread.php?t=91663&amp;amp;highlight=creation+back+buffer"&gt;Link 1&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.j2meforums.com/wiki/index.php/FAQ#Why_when_I_set_the_GameCanvas_to_full_screen_does_getHeight.28.29_not_return_the_right_value.3F"&gt;Link 2&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I encountered this bug when i tested my MIDlet on my Nokia 6630 phone. Not sure if this is applicable to any other models.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34656208-116061982441316608?l=sonusdream.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sonusdream.blogspot.com/feeds/116061982441316608/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34656208&amp;postID=116061982441316608' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34656208/posts/default/116061982441316608'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34656208/posts/default/116061982441316608'/><link rel='alternate' type='text/html' href='http://sonusdream.blogspot.com/2006/10/setfullscreen-not-working-on-phone.html' title='setFullscreen() not working on phone'/><author><name>Rey Jexter Bumalay</name><uri>http://www.blogger.com/profile/18369902492426908546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_rOrq2e7BqFI/R6sjJFXcMMI/AAAAAAAAAAQ/P75_PXRzsYY/S220/DSC01363.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34656208.post-116024792903805879</id><published>2006-10-07T11:51:00.000-07:00</published><updated>2006-10-07T13:42:04.540-07:00</updated><title type='text'>Blending / Image Transparency</title><content type='html'>This article will help you create a transparent image effect. Before we start with the actual coding you need to first understand some important things. The following are the things that you need to keep in mind so that you can properly blend an image:&lt;br /&gt;&lt;ul style="font-weight: bold;"&gt;&lt;li&gt;You must make sure that your device / system,  supports alpha transparency levels. You can use the  Display.numAlphaLevels() method to check the number of transparency level your device supports.&lt;/li&gt;&lt;/ul&gt;&lt;ul style="font-weight: bold;"&gt;&lt;li&gt;You should understand that the pixels within a mutable image is always opaque. This means that mutable image cannot be transparent. You need to work with an immutable image if you want to alter its transparency level.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul style="font-weight: bold;"&gt;&lt;li&gt;You can use the Image.isMutable() method to check if an image is mutable or immutable.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul style="font-weight: bold;"&gt;&lt;li&gt;You can use the Image.createRGBImage() to create an immutable image from a mutable image(&lt;span style="font-style: italic;"&gt;I'll show you how to use this in a short while&lt;/span&gt;).&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;By the way, I'll be using my game engine framework on this one.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1. Lets declare the image that we will be using&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;private Image img;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;2. Now lets load the image:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;// This loads the image that will serve as the background&lt;br /&gt;img = Tools.loadImage("/img1.png");&lt;br /&gt;&lt;br /&gt;&lt;/blockquote&gt;3. Now lets declare the function that will convert the mutable image to immutable image and change its opacity level:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;rgbdata.length; i="" get="" rgb="" data="" of="" pixel="rgbdata[i];" by="" masking="" the="" bits="" using="" bitwise="" operator="" int="" r="((pixel" 0x00ff0000=""&gt;private Image blend(Image img, int opacity) {&lt;br /&gt;/*&lt;br /&gt;Get the rgb data of the image; You can use the Image.getRGB() if you dont want to use my framework method&lt;br /&gt;*/&lt;br /&gt;            int[] rgbdata = Tools.getRGBData(img);&lt;br /&gt;       &lt;br /&gt;            for(int i=0; i&lt;rgbdata.length; i++) {&lt;br /&gt;                int pixel = rgbdata[i];&lt;br /&gt;               &lt;br /&gt;                // get the rgb data of the pixel by masking the bits using &amp; bitwise operator&lt;br /&gt;                int r = ((pixel &amp; 0x00ff0000) &gt;&gt; 16);&lt;br /&gt;                int g = ((pixel &amp; 0x0000ff00) &gt;&gt; 8);&lt;br /&gt;                int b = ((pixel &amp; 0x000000ff) &gt;&gt; 0);   &lt;br /&gt;               &lt;br /&gt;                // rearrange the pixel using its previous color channel values.&lt;br /&gt;                // we will only modify the alpha.&lt;br /&gt;                rgbdata[i] = (opacity &lt;&lt; 24) + (r &lt;&lt; 16) + (g &lt;&lt; 8) + b;&lt;br /&gt;            }&lt;br /&gt;            return Image.createRGBImage(rgbdata, img.getWidth(), img.getHeight(), true);&lt;br /&gt;    }&lt;br /&gt;&lt;/rgbdata.length;&gt;&lt;/blockquote&gt;You can use this method to set the level of transparency of the image. 0 is the transparent 255 is fully opaque. This function will also automatically convert mutable image to immutable image.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;4. Lets now render the images. We will render a fully opaque copy of the image and a transparent image.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;protected void render(Graphics g) {&lt;br /&gt;// clear the buffer&lt;br /&gt;g.setColor(255,255,255);&lt;br /&gt;g.fillRect(0,0,getWidth(),getHeight());&lt;br /&gt;&lt;br /&gt;// render the image without transparency&lt;br /&gt;g.drawImage(img, 0, 0, Tools.GRAPHICS_TOP_LEFT);&lt;br /&gt;&lt;br /&gt;// render the transparent image&lt;br /&gt;g.drawImage(blend(img, 70), 0, img.getHeight()/2, Tools.GRAPHICS_TOP_LEFT);&lt;br /&gt;}&lt;/blockquote&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(255, 0, 0);"&gt;Some notice:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(255, 0, 0);"&gt;I could have used the Tools.setOpacity() method but since the Tools class on my framework is not yet clean i redeclared it to reduce some confusions.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;If you dont understand why i'm using render(Graphics g) instead of paint(Graphics g) you can check out my article on how to use my game engine framework &lt;/span&gt;&lt;a style="color: rgb(51, 51, 255);" href="http://sonusdream.blogspot.com/2006/10/game-engine-framework-updated.html"&gt;here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;5. The output.&lt;br /&gt;&lt;br /&gt;&lt;img src="http://i111.photobucket.com/albums/n129/reyjexter/blending-article/blending_output.gif" border="1" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;You can download the complete source code including the game engine used in this project &lt;/span&gt;&lt;a style="color: rgb(0, 0, 0);" href="http://www.4shared.com/file/4375991/75d9f5e8/blending.html"&gt;here&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34656208-116024792903805879?l=sonusdream.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sonusdream.blogspot.com/feeds/116024792903805879/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34656208&amp;postID=116024792903805879' title='31 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34656208/posts/default/116024792903805879'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34656208/posts/default/116024792903805879'/><link rel='alternate' type='text/html' href='http://sonusdream.blogspot.com/2006/10/blending-image-transparency.html' title='Blending / Image Transparency'/><author><name>Rey Jexter Bumalay</name><uri>http://www.blogger.com/profile/18369902492426908546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_rOrq2e7BqFI/R6sjJFXcMMI/AAAAAAAAAAQ/P75_PXRzsYY/S220/DSC01363.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://i111.photobucket.com/albums/n129/reyjexter/blending-article/th_blending_output.gif' height='72' width='72'/><thr:total>31</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34656208.post-116024595906508138</id><published>2006-10-07T11:25:00.000-07:00</published><updated>2006-10-07T11:34:35.253-07:00</updated><title type='text'>Game engine framework updated!!</title><content type='html'>I have made some updates on my game engine framework&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;I have revised some major parts of the engine that optimized its performance.&lt;/li&gt;&lt;li&gt;Merged some classes to reduce the size of the output.&lt;/li&gt;&lt;li&gt;Removed some irrelevant classes.&lt;/li&gt;&lt;li&gt;The 'Tools' class is not yet clean. You can use it but it will surely change on my next update.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;You can download the updated game engine framework &lt;a href="http://www.4shared.com/file/4372303/da5592e2/engine_oct_8_2006.html"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;An example on how to use the game engine can be found &lt;a href="http://www.4shared.com/file/4372306/aa3f666d/simple_example.html"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34656208-116024595906508138?l=sonusdream.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sonusdream.blogspot.com/feeds/116024595906508138/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34656208&amp;postID=116024595906508138' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34656208/posts/default/116024595906508138'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34656208/posts/default/116024595906508138'/><link rel='alternate' type='text/html' href='http://sonusdream.blogspot.com/2006/10/game-engine-framework-updated.html' title='Game engine framework updated!!'/><author><name>Rey Jexter Bumalay</name><uri>http://www.blogger.com/profile/18369902492426908546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_rOrq2e7BqFI/R6sjJFXcMMI/AAAAAAAAAAQ/P75_PXRzsYY/S220/DSC01363.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34656208.post-115892351945251377</id><published>2006-09-22T03:51:00.000-07:00</published><updated>2006-09-22T04:13:24.106-07:00</updated><title type='text'>Manipulating the color channel of a pixel</title><content type='html'>This is a nice tutorial on manipulating the color channel of a pixel&lt;br/&gt;&lt;br/&gt;&lt;a href="http://discussion.forum.nokia.com/forum/showthread.php?t=90261"&gt;http://discussion.forum.nokia.com/forum/showthread.php?t=90261&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;thank you very much shmoove :) you rock!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34656208-115892351945251377?l=sonusdream.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sonusdream.blogspot.com/feeds/115892351945251377/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34656208&amp;postID=115892351945251377' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34656208/posts/default/115892351945251377'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34656208/posts/default/115892351945251377'/><link rel='alternate' type='text/html' href='http://sonusdream.blogspot.com/2006/09/manipulating-color-channel-of-pixel.html' title='Manipulating the color channel of a pixel'/><author><name>Rey Jexter Bumalay</name><uri>http://www.blogger.com/profile/18369902492426908546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_rOrq2e7BqFI/R6sjJFXcMMI/AAAAAAAAAAQ/P75_PXRzsYY/S220/DSC01363.JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34656208.post-115868078257174799</id><published>2006-09-19T08:39:00.000-07:00</published><updated>2006-10-07T12:22:16.816-07:00</updated><title type='text'>Setting Up Your Development Environment</title><content type='html'>Many of new j2me programmers are probably wondering what they are going to do with a bunch of code. To be honest with you, when I started studying j2me programming, It took me a while to learn about the things I needed in order to see a MIDlet in action.&lt;br /&gt;&lt;strong&gt;&lt;br /&gt;Installing the development tools&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Although you can setup your development environment in several ways, I find this process really easy because you dont need to configure anything. Just follow the instructions and you'll get yourself started with programming in no time.&lt;br /&gt;&lt;br /&gt;1. Download and install the J2SE SDK preferably version 1.4.2. You can download it &lt;a href="http://java.sun.com/javase/downloads/previous.jsp"&gt;here.&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;2. Download and install Eclipse IDE (I think you only need to unzip the archive file). You can get it &lt;a href="http://www.eclipse.org/"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;3. Download and install Nokia Carbide.j. It contains tools you can use to emulate various nokia specific devices. You can download it &lt;a href="http://forum.nokia.com/main/resources/tools_and_sdks/carbide/index.html"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Now this is the fun part.. Testing if you have properly configured your development tools. :D&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Testing the installation&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: normal;"&gt;1. To check that you have successfully incorporated carbide.j with eclipse, make sure that there are carbide icon on the upper right part of your window and a "carbide.j" option under the Tools menu exist. Take a look at the following images:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);font-size:85%;" &gt;&lt;span style="font-style: italic;"&gt;Fig 1 -  Carbide.j icons&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;img src="http://i111.photobucket.com/albums/n129/reyjexter/settingupide/carbide-icon.gif" /&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(51, 102, 255);font-size:85%;" &gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;Fig 2 - Carbide.j menu item&lt;br /&gt;&lt;img src="http://i111.photobucket.com/albums/n129/reyjexter/settingupide/carbide-menu.gif" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;2. Create a new MIDP Project ( File &gt; New &gt; Project &gt; Java &gt; MIDP Project (Nokia SDK Plug-in).  Just follow the follow the images:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255); font-style: italic;font-size:85%;" &gt;Fig 3 - Choose MIDP Project (Nokiad SDK Plugin).&lt;br /&gt;&lt;img src="http://i111.photobucket.com/albums/n129/reyjexter/settingupide/newproject-step1.gif" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style="font-weight: normal;"&gt;&lt;span style="color: rgb(51, 102, 255); font-style: italic;font-size:85%;" &gt;Fig 4 - Name your project.&lt;br /&gt;&lt;img src="http://i111.photobucket.com/albums/n129/reyjexter/settingupide/newproject-step2.gif" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style="font-weight: normal;"&gt;&lt;span style="color: rgb(51, 102, 255); font-style: italic;font-size:85%;" &gt;Fig 5 - Choose an emulator you want to use.&lt;br /&gt;&lt;img src="http://i111.photobucket.com/albums/n129/reyjexter/settingupide/newproject-step3.gif" /&gt;&lt;br /&gt;&lt;br /&gt;Fig 6 - Disable    the "Start with designer tool" option. We wont be using it here.&lt;br /&gt;&lt;img src="http://i111.photobucket.com/albums/n129/reyjexter/settingupide/newproject-step4.gif" /&gt;&lt;br /&gt;&lt;br /&gt;Fig 7 - Click finish.&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style="font-weight: normal;"&gt;&lt;br /&gt;&lt;img src="http://i111.photobucket.com/albums/n129/reyjexter/settingupide/newproject-step5.gif" /&gt;&lt;br /&gt;&lt;br /&gt;2. Lets create a MIDlet. Create a class file and name it 'MyMidlet'. Just copy the following code:&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-size:85%;" &gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;import javax.microedition.midlet.*;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;import javax.microedition.lcdui.Display;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;public class MyMidlet extends MIDlet {&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;private MyCanvas myCanvas;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;public MyMidlet() {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;    myCanvas = new MyCanvas();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;protected void startApp() throws MIDletStateChangeException {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;    Display.getDisplay(this).setCurrent(myCanvas);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;protected void pauseApp() {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;protected void destroyApp(boolean u) throws MIDletStateChangeException {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style="font-weight: normal;"&gt;3. Lets create the canvas. Create a class file and name it 'MyCanvas'. Just copy the following code:&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-size:85%;" &gt;&lt;blockquote&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;import javax.microedition.lcdui.Graphics;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;import javax.microedition.lcdui.Canvas;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;public class MyCanvas extends Canvas {&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;public MyCanvas() {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;   this.setFullScreenMode(true);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;public void paint(Graphics g ) {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;   g.setColor(0,0,0);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;   g.fillRect(0, 0, getWidth(), getHeight());&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;   g.setColor(255,255,255);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;   g.drawString("Hello World of J2ME", 10, 10, Graphics.LEFT | Graphics.TOP);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;}&lt;/span&gt;&lt;/blockquote&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;4. Run the application by clicking the "Run MIDlets on emulator" icon (see Fig 1). Note that you need to highlight the MyMidlet.java file on the package explorer so that the "Emulate" button is not disabled when you start your emulator. Take a look at the image below:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style="font-weight: normal;"&gt;&lt;span style="color: rgb(51, 102, 255); font-style: italic;font-size:85%;" &gt;Fig 9 - Running the emulator.&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-weight: normal;"&gt;&lt;span style="color: rgb(255, 0, 0);font-size:85%;" &gt;&lt;span style="font-size:100%;"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;img src="http://i111.photobucket.com/albums/n129/reyjexter/settingupide/testing-emulator.gif" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;A = The button you need to click to start the emulator.&lt;br /&gt;B = You need to highlight the MIDlet of your application so that the "Emulate" Button is not disabled.&lt;br /&gt;C = Click emulate to start the emulator.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;5. You'll see an output that looks like this one:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style="font-weight: normal;"&gt;&lt;span style="color: rgb(51, 102, 255); font-style: italic;font-size:85%;" &gt;Fig 9 -The output.&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-weight: normal;"&gt;&lt;span style="color: rgb(255, 0, 0);font-size:85%;" &gt;&lt;span style="font-size:100%;"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;img src="http://i111.photobucket.com/albums/n129/reyjexter/settingupide/output.gif" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style="font-weight: normal;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34656208-115868078257174799?l=sonusdream.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sonusdream.blogspot.com/feeds/115868078257174799/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34656208&amp;postID=115868078257174799' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34656208/posts/default/115868078257174799'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34656208/posts/default/115868078257174799'/><link rel='alternate' type='text/html' href='http://sonusdream.blogspot.com/2006/09/setting-up-your-development.html' title='Setting Up Your Development Environment'/><author><name>Rey Jexter Bumalay</name><uri>http://www.blogger.com/profile/18369902492426908546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_rOrq2e7BqFI/R6sjJFXcMMI/AAAAAAAAAAQ/P75_PXRzsYY/S220/DSC01363.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://i111.photobucket.com/albums/n129/reyjexter/settingupide/th_carbide-icon.gif' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34656208.post-115864104737472078</id><published>2006-09-18T21:31:00.000-07:00</published><updated>2006-09-19T03:19:17.576-07:00</updated><title type='text'>Welcome to by blogsite</title><content type='html'>I started this blog site to share my j2me game programming codes and at the same time help me document new things that i'll be studying.&lt;br /&gt;&lt;br /&gt;I am also a newbie j2me programmer so this will serve as a way to help me learn new things&lt;br /&gt;and hopefully as time goes by, i'll be able to acquire alot of new &amp;amp; useful game programming techniques.&lt;br /&gt;&lt;br /&gt;I'll be releasing a really simple game engine in the following days. This will be the framework that I will be using which will handle the creation of a MIDlet, the creation of game screen, will handle the game loop and many more easily.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34656208-115864104737472078?l=sonusdream.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sonusdream.blogspot.com/feeds/115864104737472078/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34656208&amp;postID=115864104737472078' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34656208/posts/default/115864104737472078'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34656208/posts/default/115864104737472078'/><link rel='alternate' type='text/html' href='http://sonusdream.blogspot.com/2006/09/welcome-to-by-blogsite.html' title='Welcome to by blogsite'/><author><name>Rey Jexter Bumalay</name><uri>http://www.blogger.com/profile/18369902492426908546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_rOrq2e7BqFI/R6sjJFXcMMI/AAAAAAAAAAQ/P75_PXRzsYY/S220/DSC01363.JPG'/></author><thr:total>0</thr:total></entry></feed>
