The Daily Click ::. Forums ::. Klik Coding Help ::. Buggy Overlapping and Door Freezing
 

Post Reply  Post Oekaki 
 

Posted By Message

slepren



Registered
  10/03/2005
Points
  33
23rd July, 2009 at 03:29:11 -

I've setup active objects as doors and used both the door qualifier and the object itself in the code(not at the same time i.e. - "player" overlapping "door.qualifier"). I've also been setting Global val A to 1 on an overlap to send the player to the next frame when the value is equal to one. This works fine except the code freezes until the user lets go of the d-pad and then it sends you to the proper frame. When trying to overlap the "player" at a horizontal door it does nothing unless I make the player jump on top of the "door". And when I say "door" I mean just an open space. I'm basing the engine from Davidn's fastloop tut. I'm not sure how to alleviate this.

 
n/a

[DELETED]

Likes to put dots on paper

Registered
  08/12/2008
Points
  118

MushroomVIP MemberARGH Sign
23rd July, 2009 at 09:09:08 -

I'm not sure why you need a fast loop to create a door that sends you to a different level?
If this is as simple as it sounds, a simple "Player collides with door" and "Change frame" should suffice.

 
n/a

OMC

What a goofball

Registered
  21/05/2007
Points
  3516

KlikCast Musician! Guy with a HatSomewhat CrazyARGH SignLikes TDCHas Donated, Thank You!Retired Admin
23rd July, 2009 at 16:32:15 -

Perhaps I missed something... but I don't think he's using a fastloop for the doors...

I think it might be a conflict with coding. We'd probably have to see the source to make sense of it. Try using collision rather than overlap, but I doubt that will help.

 

  		
  		

slepren



Registered
  10/03/2005
Points
  33
23rd July, 2009 at 21:30:31 -

You are exactly right OldManClayton. I tried not using global values but the same thing happened. I also used "on collision" and nothing happened for the horizontal doorways. I'm not exactly sure what portion of the code to show you. This same side effect happens in a tut entitled "between frame scrolling". I'm using MMF2 if that helps.

 
n/a

slepren



Registered
  10/03/2005
Points
  33
1st August, 2009 at 09:28:11 -

Here's the code...to reiterate I can't figure out why the frame freezes with the active object door sensor. Also, I can't for the life of me figure out how to make the character crouch or look up.


+ Grav("Player") < 10
-> Set Grav("Player") to Grav("Player") + 0.5

+ Grav("Player") <> 0
-> Start loop "gravity" ABS(Grav("Player")) times.

+ Player presses Fire 2
+ JumpCount("Player") = 1
+ Grav("Player") > -10
+ Grav("Player") < 10
-> Set Grav("Player") to -6
-> Set JumpCount("Player") to 0

+ Player presses Fire 2
+ Detector is overlapping a backdrop
-> Set Grav("Player") to -9
-> Set jumpcount = 1

+ Player presses Fire
+ Detector is overlapping a group 0
-> Set Grav("Player") to -9
-> Set jumpcount = 1

+ On loop "gravity"
+ Player is overlapping group 0
+ Grav("Player") > 0
-> Set Y position of Player to Y("Player")-1
-> Set Grav("Player") to 0
-> Stop loop "gravity"
-> Set jumpcount = 0
-> Set detector at 1,1 from "player

+ On loop "gravity"
+ Grav("Player") > 0
-> Set Y position of Player to Y("Player")+1
-> Set detector at 1,1 from "player

+ On loop "gravity"
+ Grav("Player") < 0
-> Set Y position of Player to Y("Player")-1
-> Set detector at 1,1 from "player

+ On loop "gravity"
+ Player is overlapping an obstacle background
+ Grav("Player") > 0
-> Set Y position of Player to Y("Player")-1
-> Set Grav("Player") to 0
-> Stop loop "gravity"
-> Set jumpcount = 0
-> Set detector at 1,1 from "player

+ On loop "gravity"
+ Player is overlapping an obstacle background
+ Grav("Player") < 0
-> Set Y position of Player to Y("Player")+1
-> Set Grav("Player") to 0
-> Stop loop "gravity"
-> Set detector at 1,1 from "player

X Repeat while player pressed fire 2
+ "Grav" < 0
-> Set "player" "Grav" +0.7

I'm not sure if this code will help if not I can post more. This is really driving me crazy.

 
n/a
   

Post Reply



 



Advertisement

Worth A Click