Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Platform Jump

Author
Message
Gamedesign er20
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: The one place you would never look...
Posted: 29th Oct 2006 21:52
This is an old Gravity code which I tried to spruce up by adding some platforms. Unforuntatly, i tried a bunch of things and could not get the sprite to land on the platform, only be stoped by it.



could anyone figure out how to get the block to land on the platform?

Cocacola and Pepsi aren't that differnt. Deal with it.
Crit
18
Years of Service
User Offline
Joined: 24th May 2006
Location:
Posted: 30th Oct 2006 01:36
This code only works for the one platform...



CHESS ENCOUNTER
Demo
WIP
Gamedesign er20
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: The one place you would never look...
Posted: 30th Oct 2006 22:03
ThanksIt worked.

Cocacola and Pepsi aren't that differnt. Deal with it.
Crit
18
Years of Service
User Offline
Joined: 24th May 2006
Location:
Posted: 30th Oct 2006 22:10
No problem. Good luck with adding more platforms!

CHESS ENCOUNTER
Demo
WIP
Gamedesign er20
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: The one place you would never look...
Posted: 30th Oct 2006 23:03
One more question, I tried adding another platform after looking at what you did, and for some strange reason it didn't work. Tell me what you think


Cocacola and Pepsi aren't that differnt. Deal with it.
Crit
18
Years of Service
User Offline
Joined: 24th May 2006
Location:
Posted: 30th Oct 2006 23:34
Hmm. I don't have dbp here to test, but I would say the "fall off the platform" code is to blame.

Maybe instead of making giant areas to check you could limit the search to a tiny square at the edge of each platform.


eg:


and then do something similar for the other platform.

Of course, if you are going to continue expanding, you should consider using arrays, functions, and user defined types. If not, your code will get very messy very quickly.

CHESS ENCOUNTER
Demo
WIP
Gamedesign er20
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: The one place you would never look...
Posted: 30th Oct 2006 23:55
Thanks, again limiting the search to a tiny square worked.

Quote: "Of course, if you are going to continue expanding, you should consider using arrays, functions, and user defined types. If not, your code will get very messy very quickly."
\

don't worry, this is just a test program to make sure everything works before I start my real game. When I do start my game, I'm going to make a function for platform collision so like you said, my code won't be messy.

Cocacola and Pepsi aren't that differnt. Deal with it.
Crit
18
Years of Service
User Offline
Joined: 24th May 2006
Location:
Posted: 31st Oct 2006 00:07
Good idea. Game design is hard if you don't have a plan.

CHESS ENCOUNTER
Demo
WIP
Gamedesign er20
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: The one place you would never look...
Posted: 2nd Nov 2006 01:37
Really sorry to bump this thread, but i don't think it is necessary to start a new one just to ask a very small question. When i dec a variable that is being printed to the screen, for example
instead of the screen reading 99 when i press the upkey, it just get's all blury. Does that happen to anyone else?

Cocacola and Pepsi aren't that differnt. Deal with it.
C0wbox
18
Years of Service
User Offline
Joined: 6th Jun 2006
Location: 0,50,-150
Posted: 2nd Nov 2006 18:24 Edited at: 2nd Nov 2006 18:26
It does with me, personally, I'd use print and CLS rather than a text command.



Edit: Whoops I forgot the CLS

It may also be too fast and you may wish to include a wait command such as wait 50 after the dec HEALTH. Just to slow it down enough that you can see what your doing.
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 3rd Nov 2006 12:40
if your on pro try fast sync in your main loop, it might alleviate a cls which is another sync in itself.

Login to post a reply

Server time is: 2024-09-25 11:34:45
Your offset time is: 2024-09-25 11:34:45