Game Development Community

"One-Way" Platform

by Robert Carroll · in TGB Platformer Kit · 11/06/2009 (5:03 am) · 2 replies

Hi Im tring to get this code to work but It won't do it evry time I go and jump up (under it) it still collides with the bottom of my scene object.

if (!isObject(PlatformBehavior))
{
	%template = new BehaviorTemplate(PlatformBehavior);

	%template.friendlyName = "Platform Object";
	%template.behaviorType = "Platform";
	%template.description  = "Platform object";

	%template.addBehaviorField(OneWay, "One-Way Platform", bool, 0);
}

function PlatformBehavior::onAddToScene(%this, %scenegraph)
{
	%this.owner.setCollisionActive(0,1);
	%this.owner.setCollisionCallback(0);

	%this.owner.setCollisionPhysics(0,0);
	%this.owner.isGround = true;

	%this.owner.isOneWay = %this.OneWay;
}


#1
11/06/2009 (7:32 pm)
This question woule be best posted on the PSK Private forum.
#2
11/06/2009 (7:43 pm)
wheres that?