Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Help with jumping in game.

  1. #1

    Help with jumping in game.

    Im trying to make a little game like super mario world see if i can pull it off n what not just using basic BitBlt.

    I cant figure out how to get the sprite to jump nicely using the arrow keys i up and down is about it but not while moving jus doesnt like me lol.

  2. #2

    Help with jumping in game.

    This is how i've done it

    Code:
      var VertSpeed: Single;
    
    
      Procedure GameLoop;
      begin
        VertSpeed:=VertSpeed - 1;
       
        IF (VK_UP in keys) and (Player.StandsOnGround)   then  VertSpeed:=20;
    
        Player.Position.Y:=Player.Position.Y + VertSpeed;
        IF Player.ColisionWithLevel then begin
           VertSpeed:=0;
           Player.PutOnGround;
        end;
      end;
    Some explanation about the functions:
    Player.ColisionWithLevel <- Tests if the player is coliding with the level at its current position.

    Player.StandsOnGround <- Tests if the player is standing on a tile instead of free-falling.

    Player.PutOnGround <- Puts the player on the top of the tile it colides with
    Amnoxx

    Oh, and this code appears to be an approximate replacement for return(random() & 0x01);

    Phoenix Wiki
    http://www.phoenixlib.net/

    Phoenix Forum
    http://www.pascalgamedevelopment.com/viewforum.php?f=71

  3. #3

    Help with jumping in game.

    I sort of understand that perhaps i should get some other thigns goin first though one im not using tiles or nesuch thing just drawing with bitblt basically.

    Also i really want to try my hand at using UnDelphiX except i wouldnt have a dam clue how to install it and there is no added documentation on how to.

    I have the one re-done for D7 and yet it still holds the executables for installing on D3/4/5.

  4. #4
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25

    Help with jumping in game.

    If you look in the 'Source' folder, you'll see a dpk file called 'DelphiX_for7.dpk'. Open that file and Hit Install. You should see a message box pop up letting you know that it's installed.
    Jason McMillen
    Pascal Game Development
    Co-Founder





  5. #5

    Help with jumping in game.

    I got

    [Fatal Error] DXConsts.pas(103): Could not create output file 'E:\Output\DXConsts.dcu'



    EDIT: nvm i changed the output directory drive and it works though kinda strange cause i do have an e:\ drive hmmm.

  6. #6

    Help with jumping in game.

    Quote Originally Posted by Chesso
    nvm i changed the output directory drive and it works though kinda strange cause i do have an e:\ drive hmmm.
    The folder needs to exists too Delphi does not create the folder.
    M109uk
    <br />--------------------------------------------------------
    <br />www.pulse-soft.oneuk.com

  7. #7
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25

    Help with jumping in game.

    One more thing... make sure you go on the main menu into 'Tools' - 'Enviroment Options...'. From there hit the 'Library' tab and at the right end of 'Library path:' there is a '...' button hit it and that'll take you to a nice screen where you can add your 'Source' folder from UnDelphiX. It'll need to find the actual dcu files to compile/run.
    Jason McMillen
    Pascal Game Development
    Co-Founder





  8. #8

    Help with jumping in game.

    well i already fixed tht prob before by throwing all the files in the one folder same as where the installed components are and added it tot he seqarch path.

  9. #9
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25

    Help with jumping in game.

    How how's your Mario project coming?

    Here is a little article on designing 'Dextarity Games' from GameDev.net: http://www.gamedev.net/reference/des.../platformdiff/

    Hope it helps.
    Jason McMillen
    Pascal Game Development
    Co-Founder





  10. #10

    Help with jumping in game.

    Woah hey it's been awhile since ive been here. I don't have any of my delphi projects anymore my power supply blew and fried alot of sht with it that'll teach me for not backing up.

    Im on Win2kPRo now and though it hogs alot of ram it run's alright i spose. I started a new platform game atm still using simple blitting it's a shinobi clone. It's basically just a draft for future reference and to learn how things work again.

    Right now im trying to re-install UnDelphiX lucky google returned this or i woulda never found this forum again cause i forgot the name lol.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •