Remove Code Remove Collision Remove Sprite
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 ". code for the “key”. code for the "character ".

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. Why is this useful?

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

Module 3: Attack of the Snake (Lesson 10)

Game Designing

And the way to do that is by altering the collision mask on our block. Now, we haven’t talked about collision masks yet, so let’s do a quick overview of them and we’re going to dive way deeper into them in the next module where we make our space game. So open up your S p R block or really any of your sprites.

article thumbnail

intersectRect not working with a sprite if is a child?

Cocos

According to my initial code, it looks like that intersectsRect() doesn’t work in world space. spriteAWorldPos.y, spriteA->getContentSize().width, width, spriteA->getContentSize().height); height); if (spriteAWorldRect.containsPoint(Vec2(spriteBWorldPos.x, spriteBWorldPos.y)) ||. spriteBWorldPos.y + spriteB->getContentSize().height)))

Sprite 40
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

Developer Shares Building Fabrics, Ropes, And Soft Bodies

Cocos

or better : with 3D scenes Origins Two days ago, I saw a fun effect: The article was: Dazzling HTML5 Front End Design Source Code Analysis Notes - Remnant Clothes Effect Example: Tearable Grid It is an effect that I’ve seen before and recently brushed up on. So I researched the code and prepared to port it to Cocos.

Build 98