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

Node Move to other node

$
0
0

@C_Stefano wrote:

Sorry but I don’t understood how works node position :frowning:
I have a player and a enemy inside a layerGame and I cannot move enemy over a locator inside player… I tried this but not works

 enemy.x = player.loc.x;
 enemy.y = player.loc.y;

how is the correct mode to move enemy over loc? sorry for noob question :pleading_face:

Stefano

Posts: 5

Participants: 2

Read full topic


CC 2.1.2 Fails To Load Projects In "Example 3D"

$
0
0

@Karg wrote:

i’m trying to open the 3d example projects from here: https://github.com/cocos-creator/example-3d

however, it fails to load. demo01 is stuck forever in “loading assets, please wait” and demo02 loads with a lots of errors like:

load script [Cocos3D] failed : Error: Cannot find module 'Cocos3D'
load script [E:\Temp\cc\example-3d-master\demo02\temp\quick-scripts\assets\scripts\audio\audio-controller.js] failed : TypeError: Cannot read property '_decorator' of undefined

any idea how to open those? i’ve noticed they’re updated quite recently, so i was hoping that the latest version might work, do they require an older version of CC?

Posts: 1

Participants: 1

Read full topic

Action has no listener?

$
0
0

@aqwer4 wrote:

i make bullet and the unit fire the bullet.
and i use action(node.runAction()) cc.moveTo for bullet’s node.

start(){
       this.action = cc.moveTo(distance / movePixel, targetX, targetY);
       this.node.runAction(action);
}

and i check finish the action in update() method.
(i think, if it has listener, use listener is better than check every frames
but i can’t found action listener. so i use this way i don’t have any choice)

 update(dt) {
        if (this.action && this.action .isDone) {
            cc.log("bullet" + this.bulletId + " is arrived to target!");
            this.damageToTarget();
        }
}

but isDone return the true in every Frame.( start action ~ end action ~ and after, all case’s isDone is return true)

why it is always ?
and is no have listener?
every frame check is no good idea

(ps> i don’t want use collision checker. )

cocos creator version : 1.10.2

Posts: 1

Participants: 1

Read full topic

Issue Export Assets Spine

$
0
0

@zintin wrote:

Hello every one,

I working in Cocos creator, I use feature Export Asset.
But when I export asset is spine, I will missing file json data ( -> error when import new project, can’t load file spine from data assets)

Please help me check issue?
Please help me I was confused in any step??
Thank so much

Posts: 1

Participants: 1

Read full topic

Particle system!

$
0
0

@C_Stefano wrote:

Hi, for cocos creator, is there a particles system tool to use for create a particles system?

Many thanks!

Stefano

Posts: 2

Participants: 2

Read full topic

don't work click event on full screen

$
0
0

@ttakei wrote:

When switching to full screen, the appearance changes correctly, but the button click event does not work correctly. It seems that the buttons are placed in different places. What can I do to make the game work properly on full screen?

Full screen switching was done with the following code.

const canvas = document.getElementById ("GameCanvas");
cc.screen ['requestFullScreen'] (canvas, () => {});

The version is v2.1.2 and the platform is Web Mobile.

Posts: 1

Participants: 1

Read full topic

When is a re-build / re-compile needed (when publish)

$
0
0

@RealChaoz wrote:

When building, let’s say, for Android, there aer 2 buttons available: build and compile. If I change, let’s say, a script, do I need to hit both of them to update or just compile? What about the other platforms? What exactly do those buttons do?

Posts: 1

Participants: 1

Read full topic

Doubts about online multiplayer game

$
0
0

@pacear10 wrote:

Greetings to all, I would like to make a Bejeweled game
or candy crush, with the option of being able to play a game between two people or maybe more and that you can also play alone

To do this kind of functionality what should be done?
Should a game be created to access via the web?
Should you upload to a platform in steam type or similar?
Or should an apk be created to install on each computer and that the app has the functionality to connect to any server to take user moves?

Can you give me a guide on how to do it please

Is there a trend about online games?

Thank you.

Posts: 1

Participants: 1

Read full topic


Android build failed

$
0
0

@C_Stefano wrote:

Hi!
We have tried to export the android project but we have this error:

make: *** No rule to make target `cocos2djs’. Stop.

we have installed Android Studios 3.5

Thanks!

Stefano

Posts: 1

Participants: 1

Read full topic

Sdkbox error (UnsatisfiedLinkError)

$
0
0

@mhmtemnacr wrote:

I imported google play services and gpg plugins to my project (using sdkbox gui). But now when i try to run the game i get this error:

java.lang.UnsatisfiedLinkError: No implementation found for void com.sdkbox.plugin.SDKBox.nativeInit

what can i do to solve this problem? please help me

Posts: 1

Participants: 1

Read full topic

Android Studio: Native build fails after and upgrade

$
0
0

@pfedor wrote:

Hi all. I just foolishly upgraded Android Studio and gradle, and now I cannot build my game. The error message is:

Build command failed.
Error while executing process /home/pfedor/Android/Sdk/ndk-bundle/ndk-build with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=/home/pfedor/hervor/Hervor/proj.android/app/jni/Android.mk NDK_APPLICATION_MK=/home/pfedor/hervor/Hervor/proj.android/app/jni/Application.mk APP_ABI=armeabi-v7a NDK_ALL_ABIS=armeabi-v7a NDK_DEBUG=1 APP_PLATFORM=android-16 NDK_OUT=/home/pfedor/hervor/Hervor/proj.android/app/build/intermediates/ndkBuild/debug/obj NDK_LIBS_OUT=/home/pfedor/hervor/Hervor/proj.android/app/build/intermediates/ndkBuild/debug/lib NDK_TOOLCHAIN_VERSION=clang -j8 NDK_MODULE_PATH=/home/pfedor/hervor/Hervor/cocos2d:/home/pfedor/hervor/Hervor/cocos2d/cocos:/home/pfedor/hervor/Hervor/cocos2d/external NDK_DEBUG=1 MyGame}

make: *** No rule to make target `MyGame'.  Stop.

My Android.mk file (which worked perfectly before the upgrade):

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := MyGame_shared

LOCAL_MODULE_FILENAME := libMyGame

FILE_LIST := $(wildcard $(LOCAL_PATH)/../../../../source/*.cc)
SHAPES_CODEGEN := $(wildcard $(LOCAL_PATH)/../../../../shapes/codegen/*.cc)
LOCAL_SRC_FILES := $(LOCAL_PATH)/hellocpp/main.cpp \
                   $(LOCAL_PATH)/../../../Classes/AppDelegate.cpp \
                   $(LOCAL_PATH)/../../../Classes/HelloWorldScene.cpp \
                   $(FILE_LIST:$(LOCAL_PATH)/%=%) \
                   $(SHAPES_CODEGEN:$(LOCAL_PATH)/%=%)

LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../Classes

# _COCOS_HEADER_ANDROID_BEGIN
# _COCOS_HEADER_ANDROID_END


LOCAL_STATIC_LIBRARIES := cc_static

# _COCOS_LIB_ANDROID_BEGIN
# _COCOS_LIB_ANDROID_END

include $(BUILD_SHARED_LIBRARY)

$(call import-module, cocos)

# _COCOS_LIB_IMPORT_ANDROID_BEGIN
# _COCOS_LIB_IMPORT_ANDROID_END

(in /proj.android/gradle.properties, I’m setting PROP_BUILD_TYPE=ndk-build)

The project is based off of the default cocos2d-x template. My Android Studio version now is 3.5, Android Gradle Plugin version 3.5.0, Gradle version 5.4.1.

I realize the way go to about it is going to be a lot of poking and trial and error, but posting this in the hope that someone has had the same problem. Thank you!

Aleksander

Posts: 1

Participants: 1

Read full topic

Github C++ MotionStreak batch node

$
0
0

@tdebock wrote:

After I solved the issues of wanting to batch MotionStreak nodes with the same texture into 1 draw call, I went ahead and abstracted the code for a public GitHub repo.

It is pretty straightforward to use, almost an exact analogy of Sprite -> SpriteBatchNode.

One thing to keep in mind, is to make the Batch work, you need to replace your instances of MotionStreak with this BatchableMotionStreak… it just allows read access to a few private attributes that were necessary for the batch to work. I wanted to subclass MotionStreak here for version compatibility etc instead of changing the cocos lib file.

There are tons of areas for improvement I have in mind (ie use true frame and index buffers, not using memcpy on the data and populating from MotionStreak class itself), but, it works as intended for me, so I am leaving it as is for now. I thought it might also serve as a good example for others on how to batch other misc / custom nodes with their own CustomCommand or other render commands etc to OpenGL with one draw call.

Posts: 1

Participants: 1

Read full topic

Undefined reference to cocos2d::unzOpen() on Windows

$
0
0

@QuincyHe wrote:

Hi! I tried to use features defined in ./external/unzip/unzip.h with Cocos2d-x V 3.17.2 but it throws this error, as if this function was not implemented… Apparently it has its definition in unzip.cpp from the same folder, and the cpp file is included as src of cococ2d project. What does this error mean? Any help is appreciated.

Posts: 2

Participants: 2

Read full topic

Developer Interview: Candy House - a casual mobile game with video acting!

How to check collision? Circle vs Rectangle

$
0
0

@aqwer4 wrote:

my gameObject sometime need to check it immediately.
it’s not case of onCollisionxxx(Enter, Stay, Exit).

so i want check collision myself, how can i do it?
the gameObject has BoxCollision.(unitArea) and CircleCollision(AttackRange area)

gameObject [A] check about [A]'s AttackRange and [B]'s unitArea.

now i use this (Rect vs Circle)
cc.Intersection.polygonCircle();
( did not have cc.Intersection.RectCircle? so i use to polygonCircle() )

// create target's rect every time when need to check it
let tArea: cc.BoxCollider = this.target.unitArea;
let targetRect: cc.Rect = new cc.Rect(this.target.node.x + tArea.offset.x, this.target.node.y + tArea.offset.y, tArea.size.width, tArea.size.height);

if(cc.Intersection.polygonCircle(
    [cc.v2(targetRect.x, targetRect.y), cc.v2(targetRect.x + targetRect.width, targetRect.y),
    cc.v2(targetRect.x + targetRect.width, targetRect.y + targetRect.height), cc.v2(targetRect.x, targetRect.y + targetRect.height)], 
    {
        position: this.node.position, 
        radius: this.attackRange.radius  // this.attackRange: cc.CircleCollider
    }))) {
       // do process collision
}

cc.BoxCollider, cc.CircleCollider has not cc.Rect and Circle.
it’s create new rect object every time when need to check it.
i think is it low efficiency.
how can i check intersect cc.BoxCollider and cc.CircleCollider directly?

please tell me, any idea, any advice!

Posts: 1

Participants: 1

Read full topic


Audio Engine doesn't support set playback rate

$
0
0

@minhtu14 wrote:

Hello everyone,

I’m making a game play with music. I wanna set playback rate follow as level of game. But I cant find any function to set it. Any body can give me some advise ?
Thanks you for reading !

Posts: 1

Participants: 1

Read full topic

Game looks blur in Chrome Browser

Native AudioEngine

$
0
0

@StudioAMK wrote:

Dear Cocos Engineers,

Recent days, I am working on audio effects implementation and notice that Cocos Creator is using WebAudio for playing audio files. To my surprise, even for native platforms, we are using WebAudio. Please kindly confirm me that I wasn’t looking at the wrong files.

Source:

Posts: 2

Participants: 1

Read full topic

--- Article Removed ---

$
0
0
***
***
*** RSSing Note: Article removed by member request. ***
***

--- Article Removed ---

$
0
0
***
***
*** RSSing Note: Article removed by member request. ***
***
Viewing all 17057 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>