×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Dec 2011
    Posts
    7

    Need tips on my current problem.

    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
    Join Date
    Oct 2008
    Posts
    40

    Re: Need tips on my current problem.

    Have you checked our Battleships game example? It's a simple multiplayer bluetooth game.

  3. #3
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,674

    Re: Need tips on my current problem.

    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
    Join Date
    May 2010
    Posts
    362

    Re: Need tips on my current problem.

    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
    Join Date
    Dec 2011
    Posts
    7

    Re: Need tips on my current problem.

    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
    Join Date
    Oct 2008
    Posts
    40

    Re: Need tips on my current problem.

    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
    Join Date
    Apr 2003
    Location
    Finland, Espoo
    Posts
    37

    Re: Need tips on my current problem.

    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
  •  
×