PDA

View Full Version : Help with jumping in game.



Chesso
03-10-2004, 07:04 AM
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.

Andreaz
03-10-2004, 07:59 AM
This is how i've done it



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

Chesso
03-10-2004, 09:17 AM
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.

WILL
03-10-2004, 12:20 PM
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. :)

Chesso
03-10-2004, 02:59 PM
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.

M109uk
03-10-2004, 03:45 PM
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.

WILL
03-10-2004, 11:13 PM
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.

Chesso
04-10-2004, 01:12 AM
well i already fixed tht prob before :P by throwing all the files in the one folder same as where the installed components are and added it tot he seqarch path.

WILL
02-11-2004, 04:38 AM
How how's your Mario project coming?

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

Hope it helps.

Chesso
18-11-2004, 03:26 AM
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.

WILL
18-11-2004, 01:39 PM
Really? Wow, well you'll have 2 chances of finding us again should your new systemdecide to spontaniously explode. ;) You should want to visit www.delphigamer.com aswell as there is tons of news updates on an almost daily basis.

And to top that off, the new PGD will feature some nice new Article and Library sections of the site.

Feel free to send screenshots, etc in the 'Your Projects' forum.

Chesso
18-11-2004, 09:19 PM
Sounds kool.

Yeah id say the power supply was party my fault around that time i really just couldnt help tinkering around with some hardware i had trying to get the most out of what i had i think i stressed the poor old thing out lol.

I didn't mind losing the projects but god was it hard to find out how to do even simple thing's again.