Quantcast
Channel: Cocos Forums - Latest topics
Viewing all 17105 articles
Browse latest View live

@properties TypeScript

$
0
0

@aqwer4 wrote:

properties: {
        // this property quotes the PreFab resource of stars
        starPrefab: {
            default: null,
            type: cc.Prefab
        },
        // the random scale of disappearing time for stars
        maxStarDuration: 0,
        minStarDuration: 0,
        // ground node for confirming the height of the generated star's position
        ground: {
            default: null,
            type: cc.Node
        },
        // player node for obtaining the jump height of the main character and controlling the movement switch of the main character
        player: {
            default: null,
            type: cc.Node
        }
    },
properties: {
    score: {
        default: 0,
        displayName: "Score (player)",
        tooltip: "The score of player",
    }
}

how can i this declaration in typescript?

now im not use array just like this :

    @property(cc.Prefab) starPrefab: cc.Prefab = null;
    @property(cc.Node) ground : cc.Node = null;
    @property(cc.Node) player : cc.Node = null;

    @property maxStarDuration: number = 0;
    @property minStarDuration: number = 0;

and try like this too, but it’s not work on Creator’s Node list (can’t drag and can’t set value)

@property({
        score : {
            default : 0,
            displayName : "Score(Player)",
            tooltip : "The score of Player"
        }
    })

Posts: 2

Participants: 2

Read full topic


how can i create my game

$
0
0

@jeanporcher wrote:

Hi everybody, im new in the world of game developpement. i want to develop an android 2d game on Pc(windows10), cocos2d is very interesting but i don’t understand which tools developers use to code their game. i have installed cocos2d with python2.7, android studio , visual studio 2019 there are others tools i have to install ? do you use cocos creator too ? thanks you in advance

Posts: 2

Participants: 2

Read full topic

Cocos Creator Stabililty/Compatibility Issues (a long Rant)

$
0
0

@abhimanyu wrote:

Hi,

We’ve got a game project that was earlier created on Cocos Creator 1.9.x version, but was put on hold due to certain reasons.

Recently we resumed the work and tried to run the project on all 3 available versions of Cocos Creator i.e. v1.10.2, v2.0.10 and v2.1.1.

It was extremely disappointing to see that none of the 3 versions are fully compatible with the code (even after making all necessary changes recommended in the upgrade project log) which was working fine earlier.

On one, the game is functionally working fine on the Cocos Simulator but breaks down the moment it tries to do the same on Android. the other 2 versions are flickering insanely on simulator itself. Rich Text has lot’s of issues in simulator itself. None of them is able to create a JSON object from a local file on Android. We tried both the following methods:

var url = cc.url.raw( "resources/Data/GlobalData.json" );
cc.loader.load( url, function( err, res) {
	dataManager.setGlobalData( res.json );
} );

Or

var gData = JSON.parse( jsb.fileUtils.getStringFromFile( cc.url.raw(path) ) );

The above issue may look like just another bug, but it has left me wondering that if the platform was not stable why were the earlier versions removed from the downloads page. I am very concerned about your approach to build the overall Cocos ecosystem.

I’ve been an ardent follower of Cocos2D since almost 8-9 years now. That’s a long enough time for this platform to become stable. But here’s my observation:

  • You abruptly end support to platforms/editors without giving a second thought about it’s impact on developers, who were dependent on it for it for all the games that were in pipeline or already released.
  • You push new releases without checking for it’s stability and backward compatibiltity.
  • Your releases are not marked as major or minor, stable or unstable.
  • Complete Change logs/Build notes are not accompanied with each release.
  • The editors are filled with all kinds of glitches.
  • The game looks and works differently, be it in Editor, Simulator or the Device.
  • Your documentation is all over the place.
  • You’ve spread your team thin trying to achieve too many things at the same time, not taking the time see the impact it has on people that are dependent on it.

You’re ready to break everything to rebuild a free replica of Unity3D, but you seem oblivious about it’s impact on existing products.
Yes Unity3D is very costly and that is one of the reasons we choose Cocos for developing games that don’t really need all kinds of fancy hodge podge. But editor cost is just one part of the development cost. A majority component of the development cost is that of hundreds of man-hours of people working on it. Their time goes to waste / idle when we run into issues because the development platform was EOL’d or unstable.

Cocos 2D once was an absolutely amazing and promising platform that we used to love developing games on but it is increasingly looking unreliable, and I’m forced to consider other platforms like Defold or Godot for future development. Yes there’s a new learning curve, but at least I’ll know that the platform is stable and dependable.

You can take this post as mindless blabber or a wake up call.

Yours Sincerely

Posts: 1

Participants: 1

Read full topic

I need somebody to run my game in an android environment

$
0
0

@Mamoxinch wrote:

Due to my several limitations, including windows home

You cannot emulate android on windows home

and having an android phone <9.0, I cannot run my android app alone. I am here to ask if someone can run my app to see if it successfully runs in an android environment. I would send a link to the private respiritory with the classes and resources.

Posts: 3

Participants: 3

Read full topic

wrong position after adding physicsbody

$
0
0

@blackcat99 wrote:

    auto moveto = MoveTo::create(1, Vec2(player->getPositionX(),y->getPositionY()));
	bullet= Sprite::create("bullet= .png");
	bullet->setScale(1.3);
	bullet->setPosition(Vec2(enemy->getPositionX(), (enemy->getPositionY()));
	bulletbody = PhysicsBody::createBox(Size(bullet->getContentSize().width, bullet->getContentSize().height));
	bulletbody->setDynamic(false);
	bulletbody->setGravityEnable(false);
	bulletbody->setCollisionBitmask(909);
	bulletbody->setContactTestBitmask(true);
	bullet->setPhysicsBody(bulletbody);
	danbody->setPositionOffset(Vec2(sp->getPositionX(), sp->getPositionY()));
	layer->addChild(bullet, 20);
	bullet->runAction(moveto);

I create a bullet at the enemy position, the enemy is a sprite.
If I don’t add physicsbody to the bullet then the position when it is created is correct but when I add physicsbody to it, it is created at the left corner of the screen (0,0); Can someone explain help me

Posts: 1

Participants: 1

Read full topic

How to change viewport to portrait?

$
0
0

@sayan wrote:

I am developing a portrait mobile game and I need to change the viewport into portrait mode. How do I do this?

Posts: 3

Participants: 2

Read full topic

Sprite Moveto to every position with the same speed?

$
0
0

@blackcat99 wrote:

My monster will shoot the player, when the player enters the range, the bullet of the monster will perform " moveTo " to the character coordinates, the problem is that if the character standing too close to the bullet will fly very slowly because i fixed the move time moveTo.

Posts: 2

Participants: 2

Read full topic

Debugging connection was colosed. Reason: Websocket disconnected

$
0
0

@Antonino wrote:

Hi guys,
I am trying to do debugging on the Simulator, for the first time.

According to Documentation, I’ve run the SImulator and opened the page “chrome-devtools://devtools/bundled/inspector.html?v8only=true&ws=0.0.0.0:5086/00010002-0003-4004-8005-000600070008”, in Chrome.

What I get is in the following figure:

Any suggestions?

Thanks in advance!

Posts: 1

Participants: 1

Read full topic


How to use procedural generation in cocos?

$
0
0

@sayan wrote:

There has been a rise in the number of platformer games and procedural generation becomes a very important component. I want to know how we can use procedural generation in cocos2d-js?

Posts: 2

Participants: 2

Read full topic

Position after adding physicsbody

$
0
0

@blackcat99 wrote:

auto moveto = MoveTo::create(1, Vec2(player->getPositionX(),y->getPositionY()));
bullet= Sprite::create("bullet= .png");
bullet->setScale(1.3);
bullet->setPosition(Vec2(enemy->getPositionX(), (enemy->getPositionY()));
bulletbody = PhysicsBody::createBox(Size(bullet->getContentSize().width, bullet->getContentSize().height));
bulletbody->setDynamic(false);
bulletbody->setGravityEnable(false);
bulletbody->setCollisionBitmask(909);
bulletbody->setContactTestBitmask(true);
bullet->setPhysicsBody(bulletbody);
danbody->setPositionOffset(Vec2(sp->getPositionX(), sp->getPositionY()));
layer->addChild(bullet, 20);
bullet->runAction(moveto);

I create a bullet at the enemy position, the enemy is a sprite.
If I don’t add physicsbody to the bullet then the position when it is created is correct but when I add physicsbody to it, it is created at the left corner of the screen (0,0); Can someone explain help me

Posts: 1

Participants: 1

Read full topic

Simple multiplayer game solutions

$
0
0

@ZauChoco wrote:

I want to create a simple multiplayer game. At the moment I am just trying to send informations from the client to the sever and vice versa.

I was thinking of the early use of socketio (This is what I would arrange), but as I can read in the doc, it seems impossible (Or hard to implement). (https://docs.cocos2d-x.org/creator/manual/en/scripting/network.html#socketio)

So I looked at the more traditional websockets, but it seems limited, and each tutorial redirects to socket.io for of a multiplayer game.

1 / Do you have ideas for another method? If possible in javascript
2 / If it’s possible, could I have more detailed information about using socket.io in cocos creator as a client?
3 / How to manage physics with these methods?

Thank you

Posts: 1

Participants: 1

Read full topic

UIVideoplayer Errors and Depereacation in iOS 9

$
0
0

@JapanDev wrote:

Are there any plans to update the UIVideoPlayer classses for iOS as the controllers are deprecated and I’m starting to get occasional random errors which cause a small video to take 3-4 secons to load…

<MPAVRoutingController 0x2809a4480 “MPAVController” dataSource=<MPAVOutputDeviceRoutingDataSource: 0x2810ef480>> timed out while fetching available routes

Best Regards

Posts: 1

Participants: 1

Read full topic

Google play 64-bit support

$
0
0

@joappdev wrote:

Hi

https://developer.android.com/distribute/best-practices/develop/64-bit

I would like to make my app support 64-bit on google play store.
After I upgrade to 3.17.1, I can build APK with arm64-v8a lib.
However, I’m not sure about should I support x86_64?

There is no support x86_64 in cocos2d-x v3.17.1 for now, how should I do to meet the requirement from Google play after 8/1 this year?

  1. support arm64-v8a armeabi-v7a x86?
  2. support arm64-v8a armeabi-v7a, remove x86?

Thanks,
Jo

Posts: 2

Participants: 1

Read full topic

Problems with Firebase Testlab

$
0
0

@piotrros wrote:

I’ve ported my app to 64-bit (“armeabi-v7a”, “arm64-v8a”) and generated aab file. I can see files for both 32 and 64-bit. Now, I’ve uploaded this file to Firebase Testlab and it cannot even install:

Failed to finalize session : INSTALL_FAILED_INVALID_APK: Split null was defined multiple times

I’ve searched for this error and I can’t find a way to solve it. I’ve also tried using bundletool install-apks and it works on my devices as well. I have instant run disabled.

Is someone using Firebase testlab and encountered similar issue?

Best regards

Posts: 1

Participants: 1

Read full topic

Windows build error of empty project in v2.0.9 & v2.0.8

$
0
0

@shishir451 wrote:

Hi @slackmoehrle,

I can not build for windows right now with cocos as the produced output application crashes on launch.
I have used empty project for test.

I have checked and faced same issue on v2.0.8 and v2.0.9.
Also 1.9.3’s output works fine.

See image.

Can anyone check and let me know if they are able to build for windows in v.2.0+ versions.

Posts: 2

Participants: 1

Read full topic


[Sample] Implement brush with cocos creator

$
0
0

@nite wrote:

I made this brush sample demonstrating how to draw with cc.Graphics

Check it out at

Inspired by the old graphics tutorial (cocos creator 1.x)

Posts: 1

Participants: 1

Read full topic

call back a line of code after a delay

$
0
0

@blackcat99 wrote:

how to call back a line of code after a delaytime.
This code is called when a collision is detected and I want it to repeat after a delay until two objects no longer collide.

Posts: 2

Participants: 2

Read full topic

Where can I find old downloads 3.17?

$
0
0

@vkreal2 wrote:

Hey Cocos2d-x, where can I find old downloads? I am looking for 3.17. Looked int GitHub below but the files don’t look right.

Posts: 1

Participants: 1

Read full topic

[PAID] Need freelance developer for platformer game

Zlib have some bug in arm64-v8a?

$
0
0

@tell_me_why wrote:

my project is cocos 3.8-lua I upgrade my cocos to 3.13.1 for google 8.1 support 64 decices.then I found
run arm64-v8a so have some problem ,in unzip.cpp

in function unzReadCurrentFile always return Z_DATA_ERROR。but run armabi is ok

i guess arm64-v8a libz.a is not correct?

then can I use chinese?

how do you guess my project(cocos3.8-lua) support google 64 devices,

Posts: 2

Participants: 2

Read full topic

Viewing all 17105 articles
Browse latest View live