perjantai 14. elokuuta 2015

Potatoman adventures - Mobile game

Long time no articles for my blog. I attended to Haaga-Helias mobile programming couse last year so this post is about my experience about mobile programming.

We had to use PhoneGap for compiling our apps, but in the end we decided to use CocoonJS for building our game. The final task of the course was to create our own mobile application of course. I haven't created any mobile games yet, so I decided with my friend we will make a mobile game for Android. I also had two Android phones to test the application.

First we decided the game should be Super Mario like 2D runner game with very easy controllers. Maximum of 4 buttons. Then we decided to use only 3 buttons. Left, right and jump. The game is easy enough to be played on the mobile. The challenging part was which game engine we should use or use our own? We found many different engines, but we wanted HTML5 based game engine, because then the game would be easy to port to any operating system. Then we found Quintus which was what we were looking for. It had mobile controllers implemented already. We decided to do at least three levels for the game, create some sound effects, background music and a little starting intro like in Max Payne which is black and white comic.

It actually took us very long to do the game. If we had created the whole engine it would have taken over a year from the team of two guys.


I was in charge of the game graphics. All graphics are done with Adobe Photoshop and Illustrator. Our game engine needed Tiled map editor for the level design. I created also the levels. Then I used microphone and Audacity to create sound effects. My partner focused on game logic and programming. When all the material were ready we also created teaser video for our application and compiled it in the CocoonJS. We had some trouble converting the game but in the end we managed to do it. It was a nice little project. To keep our code nice and clean we put it to GitHub.


Till this day 14.8.2015 our game has got over 200 downloads from the Play Store.

https://play.google.com/store/apps/details?id=com.potatoman.adventures

We got 5/5 grade for creating and publishing this game.


keskiviikko 27. toukokuuta 2015

Robots.txt file for Wordpress

For Wordpress its good idea to put wp-admin in disallow. This means Google bots don't visit wp-admin page and rank it on search.

User-agent: *
Disallow: /wp/wp-admin/

sunnuntai 23. marraskuuta 2014

Android application - pixel check

I just published my second Android application to Google PlayStore. It goes by the name "Pixel check". You can change the screen color by tapping screen. If there are dead pixels they show as black/grey and if the pixel has color errors it should stand out. Try it out here: https://play.google.com/store/apps/details?id=com.shnigi.pixelcheck





perjantai 7. marraskuuta 2014

Alphabets game

When I was a kid I played game where I had to enter all the alphabets as fast as I can. Two days ago I remembered that game and wanted to create my own version. This game is written with Javascript + HTML + CSS + PHP + MySQL. Game is created with Javascript and then PHP saves results to database. Top 10 players are queried from the database. Try it out here: http://84.251.124.101/~shnigi/aakkoset/index.php


tiistai 14. lokakuuta 2014

Javascript applications

So I have been learning Javascript for a while now and I'm getting it slowly. But still it feels so hard. I completed codeacademy.com Javascript course and had some other things to read. So far I have quickly developed three little things.

First one is rock, scissors, paper game. Simple game. Try the demoversion here: http://84.251.124.101/~shnigi/kivisaksipaperi/pewi.html


Next one is coinflipper. Select your side and flip it here: http://84.251.124.101/~shnigi/kolikonheitto/


Last one is Lotto-machine where you enter 4 different things and the machine tells you which one is best. Try it here: http://84.251.124.101/~shnigi/lottokone/

I'm planning to do a mobile app (Android) later from one of these.

perjantai 3. lokakuuta 2014

What is XML and how to use

XML was designed to describe data. With XML one can for example change data between two systems running on different platform and code. XML does not do anything. XML needs to be manipulated that it can be used. Here is an example of XML file from W3 schools:

<note>
  <to>Tove</to>
  <from>Jani</from>
  <heading>Reminder</heading>
  <body>Don't forget me this weekend!</body>
</note>

XSD is somekind of file that defines how XML file should be formatted. For example elements are defined as string and should be manipulated as string.

<xs:element name="note">
  <xs:complexType>
    <xs:sequence>
      <xs:element name="to" type="xs:string"/>
      <xs:element name="from" type="xs:string"/>
      <xs:element name="heading" type="xs:string"/>
      <xs:element name="body" type="xs:string"/>
    </xs:sequence>
  </xs:complexType>
</xs:element>
</xs:schema>

XML and XSD files can be easily generated from online converters. Next is XSLT file which is used to select data and define how it is generated in HTML file. To define the XSLT file which will be used to convert the XML file to HTML use this tag

<?xml-stylesheet href="filename.xslt" type="text/xsl" ?>

To select values from XML file with XSLT one can put HTML tags inside XSLT and then use for example for each loop to select all items. In the select tag is the "path" to the thing that should be selected. If the XML file path has "properties" use @ to select the property. Example of XSLT file:

<div>
<xsl:for-each select="sports-content/tournament/tournament-division/tournament-round">
<h3> 
<xsl:value-of select="tournament-round-metadata/site/site-metadata/home-location/@city"/>
<xsl:value-of select="tournament-round-metadata/site/site-metadata/home-location/@country"/>
</h3> 
 </div>

Then open the XML file with web browser and if it is correctly set up it will show up as HTML. Tada!


As IDE I use Eclipse. For more information check W3 Schools. I find XML hard to understand. But for example data could be changed from PHP program to Java program with XML. 

maanantai 15. syyskuuta 2014

Java Exception has occurred Eclipse

Make sure you have you have the latest version of JRE installed in your system.

If the problem still persists then ,the reason being the JRE’s of your system might not be added to the project under consideration. Please follow the steps below .
1) Eclipse Tool Bar>Window>Preferences> Java>Installed Jre’s.
2) You should be seeing the path of the JRE installed.Now copy the location of installed JREs
3) Close the window.
4) Select your Project>Rt ck >Properties>Java Build Path
5) In Libraries tab > clk Add library button
6) In Add Library Window>Select JRE System Library option>next
7) In JRE System Library window >clk on Installed JREs > (you should be able to see the path of the insatlled JREs) Select the JRE path
8) Finish

OR

Other Things done if the above did not solve the problem : - A ) Eclipse Tool bar > Project >Clean