Page 1 of 2

nearly there but... stairs grrr

PostPosted: Thu Jun 23, 2011 1:35 pm
by foleyjo
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

Re: nearly there but... stairs grrr

PostPosted: Thu Jun 23, 2011 2:11 pm
by SuperSonic
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

Re: nearly there but... stairs grrr

PostPosted: Thu Jun 23, 2011 2:25 pm
by foleyjo
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)

Re: nearly there but... stairs grrr

PostPosted: Thu Jun 23, 2011 3:36 pm
by SuperSonic
Well, it was worth a shot :D

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

Re: nearly there but... stairs grrr

PostPosted: Thu Jun 23, 2011 3:46 pm
by MrJolteon
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

Re: nearly there but... stairs grrr

PostPosted: Thu Jun 23, 2011 3:57 pm
by foleyjo
I hope they will answer my cries for help.

They often provide helpful solutions

Re: nearly there but... stairs grrr

PostPosted: Thu Jun 23, 2011 4:16 pm
by SuperSonic
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? :(

Re: nearly there but... stairs grrr

PostPosted: Thu Jun 23, 2011 4:22 pm
by MrJolteon
Yep. He told me in the chat.

Re: nearly there but... stairs grrr

PostPosted: Thu Jun 23, 2011 5:13 pm
by SuperSonic
:cry: He was one of my favorite

Is he going to come back or is he leaving for good?

Re: nearly there but... stairs grrr

PostPosted: Thu Jun 23, 2011 7:28 pm
by MrJolteon
As far as I know, he left for good.

Re: nearly there but... stairs grrr

PostPosted: Thu Jun 23, 2011 8:48 pm
by SuperSonic
Too bad. I was going to see if he would help me with my game I'm working on :)

Re: nearly there but... stairs grrr

PostPosted: Thu Jun 23, 2011 11:18 pm
by Game A Gogo
Oh that's a shame ):

Re: nearly there but... stairs grrr

PostPosted: Fri Jun 24, 2011 3:09 am
by SuperSonic
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 :)

Re: nearly there but... stairs grrr

PostPosted: Fri Jun 24, 2011 3:45 am
by skydereign
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;

Re: nearly there but... stairs grrr

PostPosted: Fri Jun 24, 2011 11:28 am
by foleyjo
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