article thumbnail

Cocos Shader Tutorial 1.0 - about UV

Cocos

Here are the implementation of water wave effects on 2D sprites and 3D meshes: Preview Link The math behind it is simple, the water wave is simulated by the Sin function, and then the fluctuation range is increased in the Update function. _pass = this.node.getComponent(Sprite).material.passes[0]; x,waveFactor.y-uv0.y); x,waveFactor.y-uv0.y);

Shaders 98
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; }

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

Decreasing Build Loading Time for Cocos Creator Mobile-Web and Desktop-Web Builds

Cocos

Uncheck debug mode in build options. Manual - Auto Atlas (textures in sprite renderers do not work yet). Compress sounds to low quality (32k, mono, 22050Hz). Use Asset Bundles and choose the right compression mode. Use the auto atlas feature in Cocos Creator 3.8 But we don’t know how to configure the build settings correctly.

Build 52
article thumbnail

Black screen on old devices cocos 2.4.11

Cocos

Also, take a look at the sprite data of the images that are showing up black… are any of them abnormally large? not file size large, but actual pixel size… if you have anything over 2k, I’d highly recommend making it smaller and testing. )

Pixel 52
article thumbnail

Best Practices for Boosting Cocos Creator's 2D Game Performance

Cocos

I’m specifically coping with the following difficulties: Frame rate decreases: I’m seeing noticeable frame rate drops when I add more sprites and animations, particularly on devices with lesser specs. What methods are there for maximising the performance of sprite animation and rendering?

Sprite 40
article thumbnail

How to Use Kaboom.js to Make Video Games

Game Designing

You can use the library to easily create scenes, add layers, build sprites, handle actions and collisions, add key events, and so much more. While other game developers might be able to tackle detailed coding requirements or easily debug code issues using their knowledge, Kaboom.js Load your Sprites and Create a Player.

Sprite 52
article thumbnail

Button animations are broken on Android devices (v3.7.3)

Cocos

When playing the game on an Android device, button animations don’t function properly (at least both Sprite and Scale transition types are affected). Also any tips or advice on how I can research and debug this issue further would be really appreciated. After some testing, it seems like this problem has started with Cocos Creator v3.7.0