Monkey

Discussion in 'Game Development (Technical)' started by joe, Mar 6, 2011.

  1. dave.h

    dave.h New Member

    Joined:
    Apr 24, 2011
    Messages:
    4
    Likes Received:
    0
    hi therevillsgames hope u dont mind if i pick your brains a bit. have you solved the running sound in android cos im still having probs. oh and thanks for posting some of your code that really helped me getting started especially since ive never done blitz.How are you exiting your program on android. Ive nearly finished a tower defence game and would like a nice exit routine instead of leaving it running in the background. I started teaching myself c++ about a year ago but i think monkey might be the way to go.The game im porting over is called towers in enferno which i wrote in c++ and directx . Anyone can view it at WWW.GAMECENTAUR.COM and download it.its basically the same but works on android by touch.i was thinking of putting a demo on the monkey site. I was suprised at how smooth the graphics run on monkey. I fancy getting in to this market cos i hate my job as a bus driver but ive no idea really if theres any money to made or even what files i need to pack or where to send them. as i am pretty much a newbie. hope u dont mind i nicked your rectoverlap routine but if u like any of the explosions ive used in my game feel free to use them.any pointers are always appreciated.
     
  2. therevillsgames

    therevillsgames New Member

    Joined:
    May 17, 2008
    Messages:
    50
    Likes Received:
    1
    Which sound problem?

    Using pure monkey/mojo:

    Code:
    If KeyHit(KEY_ESCAPE) Then Error""
    Using Diddy:

    Code:
    If KeyHit(KEY_ESCAPE)
    	game.screenFade.Start(50, true, True, True)
    	game.nextScreen = game.exitScreen
    End
    
     
  3. Grey Alien

    Indie Author

    Joined:
    Nov 29, 2005
    Messages:
    2,797
    Likes Received:
    0
    @therevillsgames: Thanks for the info! It's awesome your framework is Open Source, I may just have to grab that and use it to give me a head start.
     
  4. dave.h

    dave.h New Member

    Joined:
    Apr 24, 2011
    Messages:
    4
    Likes Received:
    0
    that exit routine was perfect thanks and with regards to sound i thought id seen a post by you that said you couldnt play sound in android. I mustve been mistaken.cheers for the help
     
  5. therevillsgames

    therevillsgames New Member

    Joined:
    May 17, 2008
    Messages:
    50
    Likes Received:
    1
    @Dave - Ive had a few issues with sound... what probs are you having?

    @GA - Grab away :) I thought it would be a good try to get the community on its feet quickly.
     
  6. dave.h

    dave.h New Member

    Joined:
    Apr 24, 2011
    Messages:
    4
    Likes Received:
    0
    hmm a few for a start in android only short files will play and not always every now and again they simply just stop for a while and while trying to play any background music in a loop it starts then just abrubtly stops.Im wondering if this is something to do with the file size but it plays when i compile it in hmtl. As far as i know im using the right files .OGG but there seems to be no consistency.
     
  7. therevillsgames

    therevillsgames New Member

    Joined:
    May 17, 2008
    Messages:
    50
    Likes Received:
    1
    Sound files have to be less than 1MB in size to be played via PlaySound.

    Music has a bug in the current version of Mojo, I raised it and Mark has fixed it but yet to release a new version... but he did send me the fix which you need to apply to the MonkeyGame.java and change openMedia to:

    Code:
           static MediaPlayer openMedia( String path ){
                   path="monkey/"+path;
    
                   try{
                           android.content.res.AssetFileDescriptor afd=getAssets().openFd( path );
    
                           MediaPlayer mp=new MediaPlayer();
                           mp.setDataSource(afd.getFileDescriptor(),afd.getStartOffset(),afd.getLength() );
                           mp.prepare();
    
                           afd.close();
                           return mp;
                   }catch( IOException e ){
                   }
                   return null;
           }
    
     
  8. dave.h

    dave.h New Member

    Joined:
    Apr 24, 2011
    Messages:
    4
    Likes Received:
    0
    cheers i reckon hes about due to release a new version anytime now
     
  9. Grey Alien

    Indie Author

    Joined:
    Nov 29, 2005
    Messages:
    2,797
    Likes Received:
    0
    Grabbed thanks! I had a chat to a local indie today and was discussing my next game which is more of an "indie" game than a casual game. I was going to make it in BMax (have a good framework after all), but if I want to put up prototypes and build traffic hype, then Flash is of course a much better way to go. So of course this means I should really use monkey so it can be easily ported as it improves.
     
  10. therevillsgames

    therevillsgames New Member

    Joined:
    May 17, 2008
    Messages:
    50
    Likes Received:
    1
    #130 therevillsgames, May 15, 2011
    Last edited: May 15, 2011
  11. Roman Budzowski

    Indie Author

    Joined:
    May 7, 2005
    Messages:
    839
    Likes Received:
    2
    Great! Congrats :)

    What phones does it work on? I tried to check it out on my HTC Wildfire but it doesn't even show in the market when I browse newest games or search for "pirate solitaire".
     
  12. therevillsgames

    therevillsgames New Member

    Joined:
    May 17, 2008
    Messages:
    50
    Likes Received:
    1
    Thanks! :)

    I think its not showing for the wildfire, due to the resolution of the phone.

    In the developer console it says:

    This is the manifest file:

    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    	package="com.therevillsgames.piratesolitaire"
    	android:versionCode="1"
    	android:versionName="1.0">
    	<uses-sdk android:minSdkVersion="3"/>
    	<application android:label="Pirate Solitaire" android:icon="@drawable/icon">
    		<activity 
    			android:name="MonkeyGame" 
    			android:label="Pirate Solitaire"
    			android:screenOrientation="landscape"
    			android:configChanges="keyboardHidden|orientation"
    			android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
    			<intent-filter>
    				<action android:name="android.intent.action.MAIN" />
    				<category android:name="android.intent.category.LAUNCHER" />
    			</intent-filter>
    		</activity>
    	</application>
    </manifest> 
    
    Ive got code in the game which should make it work on an device resolution...

    [Edit]
    Added this line:
    <supports-screens android:largeScreens="true" android:anyDensity="true" />

    And tested in the emulator for a QVGA device and it works...

    So now uploading new versions as a type this...
    [/Edit]

    [Edit 2]
    It now says this:

    So hopefully you can now find it :)
     
    #132 therevillsgames, May 15, 2011
    Last edited: May 15, 2011
  13. Roman Budzowski

    Indie Author

    Joined:
    May 7, 2005
    Messages:
    839
    Likes Received:
    2
    Still no luck. I believe Wildfire has 240x320 resolution and your screenshots on the www are 480x320. Maybe it still doesn't recognize it can be run on lower res phone?
     
  14. Grey Alien

    Indie Author

    Joined:
    Nov 29, 2005
    Messages:
    2,797
    Likes Received:
    0
    Congrats on the release, that sure was fast!
     
  15. therevillsgames

    therevillsgames New Member

    Joined:
    May 17, 2008
    Messages:
    50
    Likes Received:
    1
  16. therevillsgames

    therevillsgames New Member

    Joined:
    May 17, 2008
    Messages:
    50
    Likes Received:
    1
    Hi Roman, just updated the apk, could you have a look again please :)

    It now says this:

    Dont know what happened last night...
     
  17. Roman Budzowski

    Indie Author

    Joined:
    May 7, 2005
    Messages:
    839
    Likes Received:
    2
    OK, it shows :) Downloading TriPeaks first to see if it works at all...

    and it works! Slow, but playable. You might want to add loading screen (simple "loading..." would work), because I thought that it crashed my phone (black screen for few secs). The game also has a small bug - when you click on the deck the card goes to foundation and then "dances" near it like sinusoid wave. Definitely delta issue. It doesn't happen always, but after 2/3rd of the cards played it started to happen every time I clicked on deck.
     
  18. therevillsgames

    therevillsgames New Member

    Joined:
    May 17, 2008
    Messages:
    50
    Likes Received:
    1
    Cool... Thanks for testing :) Least it works...

    On my phone it displays the splash screen then pauses... at this time it is caching the graphics (if you dont do it before the main game, the game will slightly pause when the graphics are displayed) - I have seen it when there is just a blank screen before the splash screen, thought I fixed it.

    Hmmm Im suprised with the foundation card, I thought it would happen more from the game deck - Ill have a look.

    If you havent seen Mark has posted about some upcoming features to Monkey:

    * Interfaces
    * SetColor for images on all targets
    * HTML/Flash apps will expect documents to be served from a 'real' server
    * Android apps now work on API level 3 or higher

    http://www.monkeycoder.co.nz/Community/posts.php?topic=782
     
    #138 therevillsgames, May 16, 2011
    Last edited: May 16, 2011
  19. imma908

    imma908 New Member

    Joined:
    May 12, 2011
    Messages:
    1
    Likes Received:
    0
    wow this looks great. is monkey free? if i already have a game made from as3 can i just copy the code to monkey and let it convert them to whatever so that it can be played on other platforms?
     
  20. Roman Budzowski

    Indie Author

    Joined:
    May 7, 2005
    Messages:
    839
    Likes Received:
    2
    Monkey is just $120. No, you can't copy as3 code to Monkey... you need to write the game in Monkey and it will be able to convert it to flash and other platforms.
     

Share This Page

  • About Indie Gamer

    When the original Dexterity Forums closed in 2004, Indie Gamer was born and a diverse community has grown out of a passion for creating great games. Here you will find over 10 years of in-depth discussion on game design, the business of game development, and marketing/sales. Indie Gamer also provides a friendly place to meet up with other Developers, Artists, Composers and Writers.
  • Buy us a beer!

    Indie Gamer is delicately held together by a single poor bastard who thankfully gets help from various community volunteers. If you frequent this site or have found value in something you've learned here, help keep the site running by donating a few dollars (for beer of course)!

    Sure, I'll Buy You a Beer