Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[Delphi] Jump Event - Game

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
NothingToShow
Grandmaster Cheater Supreme
Reputation: 0

Joined: 11 Jul 2007
Posts: 1579

PostPosted: Mon Jan 14, 2008 1:34 pm    Post subject: [Delphi] Jump Event - Game Reply with quote

Hey.
I'm making a game at the moment, in Delphi, and my question is how to make a jump event.
You know any code for it?
- Møller
Back to top
View user's profile Send private message
Symbol
I'm a spammer
Reputation: 0

Joined: 18 Apr 2007
Posts: 5094
Location: Israel.

PostPosted: Mon Jan 14, 2008 2:04 pm    Post subject: Reply with quote

Define "jump"...
if you mean Image1.Top := Image1.Top - 5 then don't even bother making a "game"...
Back to top
View user's profile Send private message
NothingToShow
Grandmaster Cheater Supreme
Reputation: 0

Joined: 11 Jul 2007
Posts: 1579

PostPosted: Mon Jan 14, 2008 2:05 pm    Post subject: Reply with quote

A jump with gravity.
Back to top
View user's profile Send private message
Symbol
I'm a spammer
Reputation: 0

Joined: 18 Apr 2007
Posts: 5094
Location: Israel.

PostPosted: Mon Jan 14, 2008 2:18 pm    Post subject: Reply with quote

This is not game maker here...
Do you mean moving a picture up and down or making a real game?
well, you can make your character jump untill X pixels (just store the starting point pixels and compare them to the current) but that would really suck..
if you want gravity, set your "gravity" lets say, to 5, lets say your character speed is 50 and weight 80 (a bronze helm and a metal sword with a shiny shild, thats a lot of stuff :O don't forget the 5 pokeballs holding 5 balbazores, however you spell) so make it jump at 50 speed, compare the gravity and weight and then choose when will it fall.
You can make your weight = milliseconds in air, or whatever...
Back to top
View user's profile Send private message
NothingToShow
Grandmaster Cheater Supreme
Reputation: 0

Joined: 11 Jul 2007
Posts: 1579

PostPosted: Mon Jan 14, 2008 2:33 pm    Post subject: Reply with quote

Well, I need code haha. Smile That didnt really help me that much.
I'm trying to make a game, like the cool Slime Sport games.
I've made the jump stuff in Flash, but I cant figure out how to do it in Delphi.
Back to top
View user's profile Send private message
rapion124
Grandmaster Cheater Supreme
Reputation: 0

Joined: 25 Mar 2007
Posts: 1095

PostPosted: Mon Jan 14, 2008 2:35 pm    Post subject: Reply with quote

Delphi was never meant to make games. Try doing it in C#.
Back to top
View user's profile Send private message
NothingToShow
Grandmaster Cheater Supreme
Reputation: 0

Joined: 11 Jul 2007
Posts: 1579

PostPosted: Mon Jan 14, 2008 2:36 pm    Post subject: Reply with quote

Screw it, I believe I can do it in Delphi.
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Mon Jan 14, 2008 3:10 pm    Post subject: Reply with quote

rapion124 wrote:
Delphi was never meant to make games. Try doing it in C#.


Rolling Eyes

Something tells me there isn't going to be some generic code snippet that you just plugin and it works...
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 474

Joined: 09 May 2003
Posts: 25956
Location: The netherlands

PostPosted: Mon Jan 14, 2008 7:43 pm    Post subject: Reply with quote

Ignore those remarks you can't make a game in delphi, you can as easily as in c++ . Of course, I'm not going to give you a easy copy/paste code you can use

in your render loop when drawing the character just let it move up or down.
Best add in a believable gravity algorithm to it.

So, each time the character is rendered look up the time and calculate at which position it should be and then render it at that position untill it hits something solid. (Of course, you'll have to program that check yourself, thus keep track of everything yourself)

also, if you don't feel like using directx or direct3d, the tpaintbox component in delphi has a 'decent' enough speed for 2d games (clear screen, draw current state of the game to a in memory bitmap and at the and draw the bitmap to the paintbox and repeat)

it's easier than setting up directX/direct3d, but it'll be a bit slower, and of course, doesn't contain routines to load in vertex buffers and buffer in textures for quick access

_________________
Tools give you results. Knowledge gives you control.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
NothingToShow
Grandmaster Cheater Supreme
Reputation: 0

Joined: 11 Jul 2007
Posts: 1579

PostPosted: Tue Jan 15, 2008 5:51 am    Post subject: Reply with quote

Thank you very much Dark Byte.
I'll try to figure something out!
Back to top
View user's profile Send private message
Snootae
Grandmaster Cheater
Reputation: 0

Joined: 16 Dec 2006
Posts: 969
Location: --->

PostPosted: Wed Jan 16, 2008 9:35 am    Post subject: Reply with quote

if you wanted a sprite jumping around, you can easily do stuff like that

if you collide with the floor or a platform your jump variable = 1 and if not it = 0, you can only jump when it = 0, when you press the jump button your vertical speed increases and when your in the air you take a n amount every step from the vertical speed and, you have gravity! you have to make sure you cap your minimum negative vertical speed so it doesn't get ridiculous

not sure if collisions are easy to do or if they even work in delphi, im gonna go try
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites