Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User custom_made's Avatar
    Join Date
    Aug 2008
    Posts
    23
    hi all

    how to give a realistic feeling when the player going to fall from a height ?


    thanks in advance

  2. #2
    Nokia Developer Champion honest_success's Avatar
    Join Date
    Sep 2007
    Posts
    915
    Use the sleep(). By using sleep method you can make the execution slowewr and redraw image in paint()

  3. #3
    Registered User custom_made's Avatar
    Join Date
    Aug 2008
    Posts
    23
    hi


    its ok will it give a reakistic feeling .. i know this way i an searching for any other way like using any physics or any other technique

    thanks for the reply yaar

  4. #4
    Regular Contributor rooossone's Avatar
    Join Date
    Aug 2008
    Location
    Bournemouth, UK
    Posts
    65
    please read the thread parabolic movement, it will give you an idea of how to implement such physics
    Made With Caffiene And Sleepless Nights

  5. #5
    Registered User custom_made's Avatar
    Join Date
    Aug 2008
    Posts
    23
    how to calculate next postion using this rooosone?

    private void movePlayer()
    {

    //for(player1CurrentCol=0;player1CurrentCol< 10;player1CurrentCol++ ){

    currentPosition=sampleMap[player1CurrentRow][player1CurrentCol+1];
    //player1CurrentCol +=1;


    System.out.println("currpos>>>>>>>>>>>>>>>>>>>>>>>>>>"+currentPosition);
    switch(currentPosition){
    case -1:
    break;
    case 0:
    clnX +=1;
    break;
    case 1:
    clnX +=1;
    clnY -=1;

    break;
    case 2:
    clnX +=1;
    clnY +=1;
    break;

    }


    }

  6. #6
    Nokia Developer Champion hartti's Avatar
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,192
    Well, if the player falling means something like falling from a clif... Then parabolic movement might be an overkill.

    From physics class I can still remember that in linear movement x(t)=1/2*a*t^2+v0*t (or something along those lines...)

    Where
    a = acceleration (in this case g)
    t is time
    v0 is initial speed (=0)

    For game purposes you can forget using the exact g

    So the y position can be calculated at time t being
    y = A * t*t (where A is a suitable constant, which makes the fall happen with ok speed on the screen)

    You should be able to come up with your exact solution based on this information (unless of course I answered something else than you were really looking for...)

    Hartti

Similar Threads

  1. 6280 camera capture - no image returned?
    By neomedia in forum Mobile Java Media (Graphics & Sounds)
    Replies: 10
    Last Post: 2006-11-20, 13:29

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