article thumbnail

2D gaming performance

Cocos

As soon as the script detects that a black screen will appear soon, the script generates ground. For now, I settled on the ground generation approach (piece of ground->bridge->piece of ground) At first I wanted to attach the code, but I think it would be better to try to explain the meaning of the generation.

Sprite 52
article thumbnail

Tag to prefab dynamically and intersect in script

Cocos

This is the Cocos2dx code snippet. I want to do this in the creator-type script. count++; demo = Sprite::create(“d1”); demo->setPosition(Vec2(362.399170,831.098450)); demo->setTag(count); this->addChild(demo); if ( this ->getChildByTag(i)->getBoundingBox().containsPoint(location)) Kindly help.

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

Noob question about scripting animation

Cocos

That being said, I’m trying to determine if I can do something a certain way, and, if so, can someone provide a basic example of what the code would look like? Currently, my client engineer has 5 cards being dealt and each card sprite pulls from a random card image on an atlas. So, I am trying to create a card flip effect.

article thumbnail

Question about PolygonCollider2D

Cocos

In the editor, when you add a PolygonCollider2D to a sprite with a transparent area, the polygon is automatically created. How can I get automatic polygon creation when creating a sprite dynamically in the script code? I will be grateful for your help!

Polygon 40
article thumbnail

new jam game: Where's the beef

Radiator Blog

The concept is so simple that the Unity project has zero code / zero C# scripts. Instead, I leaned heavily on Unity UI and Unity Events for all my game implementation, playing with different button sprites that would disable each game object ("level") in sequence. Very simple.

Games 64
article thumbnail

Top Emerging Free Game Development Tools and Trends!

Big Games

Think AI that helps you build landscapes, real-time 3D sculpting like magic, and coding made accessible even for total newbies. Grab your controller because this blog is your cheat code for building the next gaming masterpiece – for free! Forget hefty price tags and complex coding. But that’s not all! Let’s jump in!

article thumbnail

Database System in Unity using Resources and ScriptableObjects

The Knights of Unity

Sprite, GameObject, Transform). Project Scripts. Scripts Structure] There are 4 main scripts in the project we are going to use, and they are explained in the further sections. Warning : In the editor, changing the ScriptableObject fields from the code level on runtime can cause weird behaviour in the Editor.

Data 52