Giter Site home page Giter Site logo

Comments (5)

alamboley avatar alamboley commented on May 12, 2024

Hi, that sounds really weird. Could you provide me a simple game state where I can encounter this issue (no problem on my side) ?

from citrus-engine.

Phantamos avatar Phantamos commented on May 12, 2024

Sure thing. I should mention you need to be in the air when you enter the sensor. But it allows you to double jump in the air. It also causes the hero to go to the idle animation for a brief second, so I am guessing some how the hero is being set to !_onGround.

Here is Main.as

package
{


import com.citrusengine.core.CitrusEngine;

import flash.display.Sprite;

[SWF(framerate="60", width="1024" , height="768", backgroundColor="0xFFFFFF")]

public class Main extends CitrusEngine
{
    public function Main()
    {

        super();
        state = new GameState();

    }


}
}

And here is GameState.as

package
{
import com.citrusengine.core.State;
import com.citrusengine.objects.platformer.box2d.*;
import com.citrusengine.physics.box2d.Box2D;

import Box2D.Dynamics.Contacts.b2Contact;



public class GameState extends State
{
    public function GameState()
    {
        super();
    }

    override public function initialize():void 
    {
        super.initialize();

        var box2d:Box2D = new Box2D("Box2d");
        add(box2d);
        box2d.visible = true;

        var hero:Hero = new Hero("bob");
        hero.x = 320;
        hero.y = 240;
        add(hero);

        var platform:Platform = new Platform("Ground", {width: 500, height:20});
        add(platform);
        platform.x = 320;
        platform.y = 400;

        var sensor:Sensor = new Sensor("test", {width:20, height:500});
        sensor.x = 150;
        sensor.y = 150;
        add(sensor);
        sensor.onEndContact.add(loadAssettsforArea1);



    }

    private function loadAssettsforArea1(contact:b2Contact):void
    {
        // do nothing

    }
}
}

from citrus-engine.

Phantamos avatar Phantamos commented on May 12, 2024

I used starling v3 with CEV3-0-0-Away3D-Box2D.swc

from citrus-engine.

alamboley avatar alamboley commented on May 12, 2024

Hi Phantamos,

Indeed there was a bug! The Hero was able to jump after a collision with a sensor. It should be fixed now, take a look on the last commit. Try with the source and tell me if everything is ok for you :)

from citrus-engine.

Phantamos avatar Phantamos commented on May 12, 2024

Works now. Thanks.

from citrus-engine.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.