nearly there but... stairs grrr

Non-platform specific questions.

nearly there but... stairs grrr

Postby foleyjo » Thu Jun 23, 2011 1:35 pm

Hi all

Sorry about this but my game is almost complete now. The coding is more or less laid down and I just need to add the enemy sprites and tile the map.

However I still can't get the steps correct so was wondering if someone could have a look and advise what to do.

I want the player to only collide with steps when

he is in front and walking towards them
he is not jumping
he is falling vertically.

The other thing I couldn't seem to get my player to do was fall straight down when there is nothing under him.

The player is the wancont actor and controls are in the draw function.
There are 2 types of steps Steps and Lsteps both going in different directions

There are other bugs that need tidying up but I already know what I'm doing there. It's just the stairs that are causing me grief.

+1 for all who try to help
Attachments
Wan.rar
(471.22 KiB) Downloaded 90 times
KISS -Keep It Simple Stoopid
foleyjo
 
Posts: 275
Joined: Mon Jul 09, 2007 1:15 pm
Score: 15 Give a positive score

Re: nearly there but... stairs grrr

Postby SuperSonic » Thu Jun 23, 2011 2:11 pm

Make a variable called "StairColl" or whatever you want to call it. Then go to your main player and add three events that say...

Player -> On collision on top side of stairs -> Script editor
Code: Select all
StairColl = 1;

Player -> On collision on any side of stairs -> Script editor
Code: Select all
if(StairColl == 1)
{
    PhysicalResponse(MOVE_EVENT_ACTOR_ONLY, USE_SPECIFIED_MASS, 1.000000, 1.000000, 1.000000, 1.000000);
}

Player -> Key down (space, no repeat) -> Script editor
Code: Select all
StairColl = 0;
yvelocity = whatever;


I hope that helped :D
A tree never hits an automobile except in self-defence.

Want to use your joystick or controller with Game Editor? Check out my controller engine =D
User avatar
SuperSonic
 
Posts: 1443
Joined: Fri Sep 24, 2010 9:24 pm
Location: Anywhere
Score: 72 Give a positive score

Re: nearly there but... stairs grrr

Postby foleyjo » Thu Jun 23, 2011 2:25 pm

No it didn't work

I might have done it wrong or it may not work due to the other coding I've been using :(

(kept my +1 promise though)
KISS -Keep It Simple Stoopid
foleyjo
 
Posts: 275
Joined: Mon Jul 09, 2007 1:15 pm
Score: 15 Give a positive score

Re: nearly there but... stairs grrr

Postby SuperSonic » Thu Jun 23, 2011 3:36 pm

Well, it was worth a shot :D

You might want to ask bee ant or lcl. They would know :wink:
A tree never hits an automobile except in self-defence.

Want to use your joystick or controller with Game Editor? Check out my controller engine =D
User avatar
SuperSonic
 
Posts: 1443
Joined: Fri Sep 24, 2010 9:24 pm
Location: Anywhere
Score: 72 Give a positive score

Re: nearly there but... stairs grrr

Postby MrJolteon » Thu Jun 23, 2011 3:46 pm

SuperSonic wrote:You might want to ask bee ant or lcl. They would know :wink:

Not Bee-Ant, he quit as a developer a few weeks back
Join us on Discord!
Game Editor 2
These are the best ways to reach me these days


Your local Community Janitor, always lurking in the shadows...
User avatar
MrJolteon
 
Posts: 2326
Joined: Sat Aug 09, 2008 3:25 pm
Location: Stranded under endless sky
Score: 105 Give a positive score

Re: nearly there but... stairs grrr

Postby foleyjo » Thu Jun 23, 2011 3:57 pm

I hope they will answer my cries for help.

They often provide helpful solutions
KISS -Keep It Simple Stoopid
foleyjo
 
Posts: 275
Joined: Mon Jul 09, 2007 1:15 pm
Score: 15 Give a positive score

Re: nearly there but... stairs grrr

Postby SuperSonic » Thu Jun 23, 2011 4:16 pm

MrJolteon wrote:
SuperSonic wrote:You might want to ask bee ant or lcl. They would know :wink:

Not Bee-Ant, he quit as a developer a few weeks back

Really? :(
A tree never hits an automobile except in self-defence.

Want to use your joystick or controller with Game Editor? Check out my controller engine =D
User avatar
SuperSonic
 
Posts: 1443
Joined: Fri Sep 24, 2010 9:24 pm
Location: Anywhere
Score: 72 Give a positive score

Re: nearly there but... stairs grrr

Postby MrJolteon » Thu Jun 23, 2011 4:22 pm

Yep. He told me in the chat.
Join us on Discord!
Game Editor 2
These are the best ways to reach me these days


Your local Community Janitor, always lurking in the shadows...
User avatar
MrJolteon
 
Posts: 2326
Joined: Sat Aug 09, 2008 3:25 pm
Location: Stranded under endless sky
Score: 105 Give a positive score

Re: nearly there but... stairs grrr

Postby SuperSonic » Thu Jun 23, 2011 5:13 pm

:cry: He was one of my favorite

Is he going to come back or is he leaving for good?
A tree never hits an automobile except in self-defence.

Want to use your joystick or controller with Game Editor? Check out my controller engine =D
User avatar
SuperSonic
 
Posts: 1443
Joined: Fri Sep 24, 2010 9:24 pm
Location: Anywhere
Score: 72 Give a positive score

Re: nearly there but... stairs grrr

Postby MrJolteon » Thu Jun 23, 2011 7:28 pm

As far as I know, he left for good.
Join us on Discord!
Game Editor 2
These are the best ways to reach me these days


Your local Community Janitor, always lurking in the shadows...
User avatar
MrJolteon
 
Posts: 2326
Joined: Sat Aug 09, 2008 3:25 pm
Location: Stranded under endless sky
Score: 105 Give a positive score

Re: nearly there but... stairs grrr

Postby SuperSonic » Thu Jun 23, 2011 8:48 pm

Too bad. I was going to see if he would help me with my game I'm working on :)
A tree never hits an automobile except in self-defence.

Want to use your joystick or controller with Game Editor? Check out my controller engine =D
User avatar
SuperSonic
 
Posts: 1443
Joined: Fri Sep 24, 2010 9:24 pm
Location: Anywhere
Score: 72 Give a positive score

Re: nearly there but... stairs grrr

Postby Game A Gogo » Thu Jun 23, 2011 11:18 pm

Oh that's a shame ):
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Re: nearly there but... stairs grrr

Postby SuperSonic » Fri Jun 24, 2011 3:09 am

Oops I forgot, we're supposed to help foleyjo. Sorry about that foleyjo :P

Do you have any ideas how to fix the stairs Gogo? I'm stumped :)
A tree never hits an automobile except in self-defence.

Want to use your joystick or controller with Game Editor? Check out my controller engine =D
User avatar
SuperSonic
 
Posts: 1443
Joined: Fri Sep 24, 2010 9:24 pm
Location: Anywhere
Score: 72 Give a positive score

Re: nearly there but... stairs grrr

Postby skydereign » Fri Jun 24, 2011 3:45 am

Well from a cursory look the collisions aren't very optimal. I'd probably restructure them entirely. One thing to note is you have this in some of the collision events.
Code: Select all
if(yvelocity = Gravity)

That isn't a comparison. That is the same as doing this in most cases.
Code: Select all
yvelocity=Gravity;
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: nearly there but... stairs grrr

Postby foleyjo » Fri Jun 24, 2011 11:28 am

Thanks for that.
I didn't notice I had only used the 1 = sign in my ifs. It's always good to have a fresh eye look over things.

I'll try redoing my collisions later today when I get a moment
KISS -Keep It Simple Stoopid
foleyjo
 
Posts: 275
Joined: Mon Jul 09, 2007 1:15 pm
Score: 15 Give a positive score

Next

Return to General

Who is online

Users browsing this forum: No registered users and 1 guest