Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User balubad's Avatar
    Join Date
    Dec 2011
    Posts
    7
    I'm developing a multiplayer game through bluetooth and this is my first project.
    My questions are:

    1. Is it ok to create enemy during runtime? I mean lots of enemies that shoots lots of bullet too w/ animation w/ images having sizes ranging from 5-10 kb per sprites?
    2. How many millisecond does the thread needs to wait?
    3. I have two mobile phone, (1)one nokia 5310 XM and (1) nokia 5730 XM , I know 5730 is more powerful compared to 5310, but when running the game 5310 is faster especially when I test the bluetooth connectivity.

    Sorry for my bad english but hope you can help me. Thanks!

  2. #2
    Nokia Developer Expert mikpeson's Avatar
    Join Date
    Oct 2008
    Posts
    40
    Have you checked our Battleships game example? It's a simple multiplayer bluetooth game.

  3. #3
    Nokia Developer Moderator wizard_hu_'s Avatar
    Join Date
    Feb 2006
    Location
    Mallorca, Holiday
    Posts
    27,683
    Mikpeson: although he does not mention it, the 5310 and his other threads suggest that the platform is Java ME.
    1) I am not sure what you mean on 'create', but according to 3) your game actually works, so it is probably Ok
    2) Wait for what? If you mean for updating the game state, it might be better to use a Timer

    Note that there are downloadable examples on this site, including some games. Visit 'Resources' above, select 'Code examples', then pick 'Java' as technology.

  4. #4
    Regular Contributor teemup's Avatar
    Join Date
    May 2010
    Posts
    362
    I'd also like to add that it sounds alarming if you plan to have separate sprite graphics for all bullets and enemies.
    If the entities share the same graphics, then there is no reason to duplicate them in the memory.

  5. #5
    Registered User balubad's Avatar
    Join Date
    Dec 2011
    Posts
    7
    Quote Originally Posted by wizard_hu_ View Post
    Mikpeson: although he does not mention it, the 5310 and his other threads suggest that the platform is Java ME.
    1) I am not sure what you mean on 'create', but according to 3) your game actually works, so it is probably Ok
    2) Wait for what? If you mean for updating the game state, it might be better to use a Timer

    Note that there are downloadable examples on this site, including some games. Visit 'Resources' above, select 'Code examples', then pick 'Java' as technology.
    Thanks for your replies.

    What I mean in create is creating objects during runtime, e.g. I have a plane object and create 10 of them put it in a vector then delete them later and if I need another plane I'll re-create again instead of recycling, or is it much better to make 20 plane objects array then call them in my game at different time?

    About the "wait" thing, if how many seconds will my thread sleep? I used wait cause that's what I used to halt my program not Thread.sleep.

    I read somewhere that using timer puts extra load on a program cause it creates another thread so I decided to use a variable that incerements in my loop inside the run interface and use it as my counter to trigger enemy appearance. Sorry for being noob, I'ts been few months since I started java and I have no idea on how to do this right.

    Thanks again! =)

  6. #6
    Nokia Developer Expert mikpeson's Avatar
    Join Date
    Oct 2008
    Posts
    40
    Check our S40 Racer and Battletank games examples from developer.nokia.com/games. These should demonstrate how to do animation with multiple sprites.

  7. #7
    Registered User lucidmind's Avatar
    Join Date
    Apr 2003
    Location
    Finland, Espoo
    Posts
    37
    Quote Originally Posted by balubad View Post
    Thanks for your replies.

    What I mean in create is creating objects during runtime, e.g. I have a plane object and create 10 of them put it in a vector then delete them later and if I need another plane I'll re-create again instead of recycling, or is it much better to make 20 plane objects array then call them in my game at different time?
    That is a traditional memory versus performance problem, if your planes don't take many too many resources, but take some time to construct (load graphics or other initialization) then precreate them. Initialization in memory is usually pretty quick, but any IO to memory might create a jerk. So to guarantee smooth performance reserve all resources in the beginning of the level, to maximize resources reserve as needed.

Similar Threads

  1. How can I get the current font color of current theme ?
    By nadis in forum Symbian Media (Closed)
    Replies: 5
    Last Post: 2009-05-08, 23:36
  2. Problem with Current network information
    By Tejaswini in forum Symbian Networking & Messaging (Closed)
    Replies: 18
    Last Post: 2007-05-15, 16:22
  3. Problem with Current network information
    By Tejaswini in forum Mobile Java Networking & Messaging & Security
    Replies: 0
    Last Post: 2007-05-09, 13:55
  4. Problem with Current network information
    By Tejaswini in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2007-05-09, 13:55

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved