article thumbnail

Handle the collision of sprites

Cocos

I’m trying to handle the collision of two sprites, i added BoxCollider2D to the sprites. One sprite can jump (changing the y coordinate through animation), named "character ", the other is a static object, named “key”. code for the "character ". start () {. this.collider.on(Contact2DType.BEGIN_CONTACT, code for the “key”.

article thumbnail

Atari ST Programming: STOS BASIC Sprite Movement

Retro Game Coders

In the last part of this STOS BASIC Tutorial we loaded a sprite but it just sat there, let’s fix that … One of the ways that STOS BASIC helps us to build interactive programs and games is in the sprite movement features because they are not only easy, but they do their thing without our constant input. Custom Mouse Pointer.

Sprite 52
Insiders

Sign Up for our Newsletter

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Trending Sources

article thumbnail

Handle the collision of sprites

Cocos

best way to debug this kind of bugs is to activate physic debugging, add this to your code. onLoad() { PhysicsSystem2D.instance.debugDrawFlags = EPhysics2DDrawFlags.Aabb | EPhysics2DDrawFlags.Pair | EPhysics2DDrawFlags.CenterOfMass | EPhysics2DDrawFlags.Joint | EPhysics2DDrawFlags.Shape; }

article thumbnail

Atari ST Programming: A Simple Game in STOS

Retro Game Coders

Now we can move sprites in STOS we need to put things together to see how we can actually begin creating playable games. This isn’t intended to be super fun, just ensure we know how to have a bad guy sprite that can cause the game to end when our player character is eaten. Background Tiles and Beating the Sprite Limits.

Sprite 52
article thumbnail

[SOLVED] cc.director.getCollisionManager is not a function?

Cocos

@Koei Thank a lot you saved my life I referred this for collision detection with another object. link] I added another sprite with different group name to test out collision and it worked… Thank you very much!

article thumbnail

intersectRect not working with a sprite if is a child?

Cocos

And the intersection is only detected with sprite C, so it seem that intersectRect() doesn’t work with a sprite if is a child. Hello, I was wondering why this is not working. I have a spriteA moving across spriteB and spirteC. spriteB is a child of a node. include "HelloWorldScene.h" #include "AudioEngine.h" thanks, R

Sprite 40
article thumbnail

intersectRect not working with a sprite if is a child?

Cocos

spriteAWorldPos.y, spriteA->getContentSize().width, width, spriteA->getContentSize().height); height); if (spriteAWorldRect.containsPoint(Vec2(spriteBWorldPos.x, spriteBWorldPos.y)) ||. spriteAWorldRect.containsPoint(Vec2(spriteBWorldPos.x + spriteB->getContentSize().width, width, spriteBWorldPos.y + spriteB->getContentSize().height))

Sprite 40