[Example] New Platformer Engine -Pixel Perfect Collisions-

Learn to use DS Game Maker by Example.

Re: [Example] New Platformer Engine -Pixel Perfect Collision

Postby Bobbyloujo » August 28th, 2011, 6:58 pm

Buck_7 wrote:I double jump, then as I land to touch the ground, I fall through it instead.

Strange, that has never happened to me. I actually sat here for like 5 minutes trying to fall through the floor and I couldn't :/ Do that happen often or was it just one time? And have you tampered with the code at all?

thedark wrote:got the error
i downloaded your file in to the wrong dir.
the dsgm file was in the action so thats caused the error

it works

That's good that you got it to work.

I might release a more up-to-date one soon. Just realized that half the code isn't need.
Image
User avatar
Bobbyloujo
Site Admin
 
Posts: 1385
Joined: December 30th, 2010, 8:40 pm
Location: USA

Re: [Example] New Platformer Engine -Pixel Perfect Collision

Postby Buck_7 » August 28th, 2011, 7:04 pm

Bobbyloujo wrote:
Buck_7 wrote:I double jump, then as I land to touch the ground, I fall through it instead.

Strange, that has never happened to me. I actually sat here for like 5 minutes trying to fall through the floor and I couldn't :/ Do that happen often or was it just one time? And have you tampered with the code at all?

thedark wrote:got the error
i downloaded your file in to the wrong dir.
the dsgm file was in the action so thats caused the error

it works

That's good that you got it to work.

I might release a more up-to-date one soon. Just realized that half the code isn't need.

Well I did change some things. Look.
User avatar
Buck_7
 
Posts: 1460
Joined: February 19th, 2011, 1:44 am

Re: [Example] New Platformer Engine -Pixel Perfect Collision

Postby Bobbyloujo » August 28th, 2011, 7:12 pm

I think I know what the problem is. Use a separate background for the collision map. The ground is going to have to be more than one pixel thick or else the player won't be able to detect it. With my next release I will make it easier to use a different background for the collision map.

EDIT: Here's my update. Got rid of about half the code in the step event. There's no more double jumping. There's better wall detection and you can jump through the bottoms of platforms.

As for the collision map, it's a little different. There's a new variable called "layer". This variable tells the code which layer the collision map will be loaded onto. If you collision map is different from your normal background, change "layer" to 3. The Object_BackgroundLoader object loads the collision background for you so you don't have to put it in the room. Use the drop down box in the room settings to load your normal background.

For example, Buck:

In Room_1, set this as your background:
example.bmp
example.bmp (49.05 KiB) Viewed 16273 times


Then change "Background_Col" to this:
exampleCollision.bmp
exampleCollision.bmp (49.05 KiB) Viewed 16273 times

Notice how thick the gray parts are on the collision map.

Then go to global variables and change "layer" to 3. By default, backgrounds are loaded to layer 2. Putting the collision map on layer 3 will hide it behind the real background.

I hope this was clear enough. I'm not great at explaining things.
Attachments
New Platformer Engine.dsgm
(4.44 KiB) Downloaded 390 times
Image
User avatar
Bobbyloujo
Site Admin
 
Posts: 1385
Joined: December 30th, 2010, 8:40 pm
Location: USA

Re: [Example] New Platformer Engine -Pixel Perfect Collision

Postby Bobbyloujo » August 31st, 2011, 6:52 pm

Well this topic died quickly. I was kinda proud of this too. :/
Image
User avatar
Bobbyloujo
Site Admin
 
Posts: 1385
Joined: December 30th, 2010, 8:40 pm
Location: USA

Re: [Example] New Platformer Engine -Pixel Perfect Collision

Postby Buck_7 » August 31st, 2011, 9:47 pm

No I like it! And I bet people can use these examples as a part of their games too. Thakns for the examples.
User avatar
Buck_7
 
Posts: 1460
Joined: February 19th, 2011, 1:44 am

Re: [Example] New Platformer Engine -Pixel Perfect Collision

Postby Bobbyloujo » August 31st, 2011, 11:30 pm

Ha, thanks. I thought I just confused people too much or something because no one replied...
Image
User avatar
Bobbyloujo
Site Admin
 
Posts: 1385
Joined: December 30th, 2010, 8:40 pm
Location: USA

Re: [Example] New Platformer Engine -Pixel Perfect Collision

Postby Buck_7 » September 1st, 2011, 12:01 am

I just haven't got around to responding till now.
User avatar
Buck_7
 
Posts: 1460
Joined: February 19th, 2011, 1:44 am

Re: [Example] New Platformer Engine -Pixel Perfect Collision

Postby Sonic The Hedgehog » September 1st, 2011, 3:12 am

Wait so this uses layers :?:
Sonic is gone for good as far as I know.
Or is he?
Spoiler: show
Probably
User avatar
Sonic The Hedgehog
 
Posts: 807
Joined: June 22nd, 2011, 12:26 pm
Location: My happy place

Re: [Example] New Platformer Engine -Pixel Perfect Collision

Postby Nobody » September 1st, 2011, 3:17 am

i've never even actually sat down to look at this before
Feel free to ask me for help. I'm on the forum a lot.

Recent Projects:
Retro Ducks: viewtopic.php?f=13&t=3533 (latest)
The Living Dead 2: viewtopic.php?f=13&t=3483
Crafters DS (Minecraft 2D Clone!) viewtopic.php?f=13&t=3082
User avatar
Nobody
 
Posts: 2323
Joined: February 14th, 2011, 12:08 am
Location: United States of America

Re: [Example] New Platformer Engine -Pixel Perfect Collision

Postby Bobbyloujo » September 1st, 2011, 5:33 am

Yup it uses layers. The collision map goes on layer 3 and the normal background goes on layer 2.
Image
User avatar
Bobbyloujo
Site Admin
 
Posts: 1385
Joined: December 30th, 2010, 8:40 pm
Location: USA

Re: [Example] New Platformer Engine -Pixel Perfect Collision

Postby albertoha94 » September 3rd, 2011, 5:13 pm

Dude this is awesome :D
I'm back!... I guess..
Ready and reloaded!
albertoha94
 
Posts: 178
Joined: January 4th, 2011, 4:57 pm

Re: [Example] New Platformer Engine -Pixel Perfect Collision

Postby Sonic The Hedgehog » September 5th, 2011, 9:33 am

Um the second example does not have layers :?:
Sonic is gone for good as far as I know.
Or is he?
Spoiler: show
Probably
User avatar
Sonic The Hedgehog
 
Posts: 807
Joined: June 22nd, 2011, 12:26 pm
Location: My happy place

Re: [Example] New Platformer Engine -Pixel Perfect Collision

Postby Bobbyloujo » September 5th, 2011, 9:59 pm

I didn't use them but could put them in though.


Actually, as I was whipping up an example, I noticed that it didn't quite work. It was an easy fix though. Notice how 'layer' is set to 3. Object_BackgroundLoader loads the collision map. The visible background is just loaded with the room settings.
Attachments
New Platformer Engine.dsgm
(94.5 KiB) Downloaded 371 times
Image
User avatar
Bobbyloujo
Site Admin
 
Posts: 1385
Joined: December 30th, 2010, 8:40 pm
Location: USA

Re: [Example] New Platformer Engine -Pixel Perfect Collision

Postby Shokupan » October 1st, 2011, 11:25 pm

Hm, doesn't work for me.

All I got is the collision map and a ball falling down.
Shokupan
 
Posts: 12
Joined: May 8th, 2011, 5:33 pm
Location: Germany

Re: [Example] New Platformer Engine -Pixel Perfect Collision

Postby Bobbyloujo » October 1st, 2011, 11:32 pm

It's a DSGM glitch. Looks like DSGM is adding unnecessary characters again. This time it's "(". Unfortunately I can't fix it :/ Try re-downloading the .dsgm. That might work. I don't know.

EDIT: Oh you edited your post. Uhm. Did you change any of the actions?
Image
User avatar
Bobbyloujo
Site Admin
 
Posts: 1385
Joined: December 30th, 2010, 8:40 pm
Location: USA

Re: [Example] New Platformer Engine -Pixel Perfect Collision

Postby Shokupan » October 1st, 2011, 11:42 pm

Nope, I didn't change anything. :/

That's how it looks like..
Attachments
Platformer_Fail.nds
(365.06 KiB) Downloaded 327 times
Shokupan
 
Posts: 12
Joined: May 8th, 2011, 5:33 pm
Location: Germany

Re: [Example] New Platformer Engine -Pixel Perfect Collision

Postby Bobbyloujo » October 2nd, 2011, 12:36 am

That's weird :/
Image
User avatar
Bobbyloujo
Site Admin
 
Posts: 1385
Joined: December 30th, 2010, 8:40 pm
Location: USA

Re: [Example] New Platformer Engine -Pixel Perfect Collision

Postby Shokupan » October 2nd, 2011, 8:17 am

I discovered that there's a difference between the 'If BG Pixel Color' action in your old
version and your newer version.

http://img822.imageshack.us/img822/4193/blubbd.png

Seems like you edited the 'Change Background' action, eh?

I don't see the 'Background_Visible'. The 'Change Background' action overwrites it, so it shows 'Background_Col' instead. I think it's because the layer thing isn't working.
(by the way, the collision thing works again if I change the variable 'layer' to 2. which is just logical)
Shokupan
 
Posts: 12
Joined: May 8th, 2011, 5:33 pm
Location: Germany

Re: [Example] New Platformer Engine -Pixel Perfect Collision

Postby Bobbyloujo » October 2nd, 2011, 5:31 pm

Shokupan wrote:I discovered that there's a difference between the 'If BG Pixel Color' action in your old
version and your newer version.

http://img822.imageshack.us/img822/4193/blubbd.png

That shouldn't be... I never changed it. Can you post your .dsgm please?
Image
User avatar
Bobbyloujo
Site Admin
 
Posts: 1385
Joined: December 30th, 2010, 8:40 pm
Location: USA

Re: [Example] New Platformer Engine -Pixel Perfect Collision

Postby aekara » November 23rd, 2011, 8:26 pm

Hey!
I have just fully understand your platformer engine and i wanted to try something.I want to use both screens like if i am on the top screen and go down i will fall to the buttom screen.i know how to use both screens but it doesnt seem to work with this.If i use your engine with 2 screen if i load a background on the top screen and then an other to the buttom it doesnt work and i think the problem is on the "If BG Colour" action where you select the screen and i cant select both screens.Is there a way to use both screens?
Working on something big!

My web site here.
aekara
 
Posts: 690
Joined: July 12th, 2011, 1:24 pm
Location: Earth

PreviousNext

Return to Tutorials

Who is online

Users browsing this forum: No registered users and 1 guest