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.

Code Snippets / [DBP] - Sparky's collision example

Author
Message
TheComet
15
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 3rd Aug 2011 18:51
Hey all


There have been a lot of questions lately like "how do i do collision" or "how does i make da characterz jumpzorz", so here is a little demo program handling both of those subjects. It's fairly well commented, so there shouldn't be a problem with understanding it. You can edit the shape of the level by changing the values at the very bottom of the code.


I hope some people can learn from this, if you have any questions, fire away!

TheComet

Orion_Uk
12
Years of Service
User Offline
Joined: 14th Jul 2010
Location: Isle Of Wight
Posted: 5th Aug 2011 02:21
Hi,

I have only taken a brief look but this seems like it will be real helpful to me as I start my quest learning DBP

Thank you for taking the time to post this here, I will let you know how I get on further down the line, credit 2 u
Mugen Wizardry
User Banned
Posted: 30th Aug 2011 16:08 Edited at: 30th Aug 2011 16:15
Here's an even better version that takes a variable into account both when jumping, and when power jumping. It stops the use of holding down the jump or the power jump keys.

EDIT: Even BETTER code that ALSO stops regular jumping when you activate the powerup!



Credit: TheComet for the idea, and me for the fix

CHECK OUT MY WEBSITE AT http://imageposeidon.com/ !
Yodaman Jer
User Banned
Posted: 7th Sep 2011 10:06
Nice demo Comet! It's very well done and very easy to understand. Will definitely come in handy for me!


^ Click for my Deviant page!
Yodaman Jer
User Banned
Posted: 9th Sep 2011 18:14 Edited at: 9th Sep 2011 18:23
Hmm, I don't suppose anyone can tell me why my player object is flying up constantly, can they? It's weird:

Main Source File:


Routines file:


To use:

Copy>paste and save both files to dba, then create a project folder named whatever. In it, make another folder called DATA, then within the DATA folder create a folder named SET.

EDIT: hmm, fixed it. Seems to be that it doesn't like setting up collision in a for-next loop.

EDIT 2: Updated the routines file in here. Now I can't get the sphere to recognize that the box is set up for collision. Looking through the code, I know I'm definitely missing a chunk...I'm still new to Sparky's syntax, can someone help me figure out box collision? Thanks!


^ Click for my Deviant page!
GlenNU
11
Years of Service
User Offline
Joined: 10th Oct 2011
Location:
Posted: 17th Oct 2011 06:07
Hi,

what plugin does it require?



-
TheComet
15
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 17th Oct 2011 13:29
@ GlenNU - The example requires Sparky's collision plugin. You can download it here : http://forum.thegamecreators.com/?m=forum_view&t=74762&b=5

TheComet

Login to post a reply

Server time is: 2022-11-30 13:41:59
Your offset time is: 2022-11-30 13:41:59