• Content Count

  • Joined

  • Last visited

About espace

  • Rank
    Advanced Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. espace

    again audio pause not working ?

  2. espace

    again audio pause not working ?

    hi, on the example it works : but on real it doesn't works .....? Phaser CE 2.12.0 - on firefox and on android var s={}; var f={} f.create_sounds=()=>{"music");;; } f.mute_sounds=()=>{; } f.create_sounds(); //ok i hear the music setTimeout(()=>{f.mute_sounds()}, 1000);//not works What is wrong ?
  3. espace

    how to make a perpetual movement with random

    update nobody?
  4. espace

    how to make a perpetual movement with random

    hi again me ! thanks for your previous solution. I have another request that looks a lot like the first but I can not solve it. I would like to have random object in x first. Then i would like to move them and when they reach -400 in x (left outside the screen), their position is set to 2000 (right outside the screen). The problem is that i see the "restart effect". It's difficult to me to explain... look at this snippet, it's easier to understand function create() { var sprite=[] var tw=[]; for (var i = 0; i < 5; i++) { sprite[i]=game.add.sprite(Math.random()*800, i*100, 'phaser'); } var move=()=>{ for (var i = 0; i < 5; i++) { tw[i]=game.add.tween(sprite[i]).to({x:-400},1000,Phaser.Easing.Linear.none,true,0,-1) tw[i].onLoop.add(function(){ //normally i must not see the sprite at the restart because it's outside the screen ? this.x=2000 this.y=Math.random()*800 },sprite[i]) } } move(); }
  5. hi, I would like to make a perpetual movement with my sprites to give the illusion of movement. In the snippet below , if the sprite are stars you will understand that for example a rocket move trough. The problem here is : on each movement i would like at the oncomplete function move the sprite randomely on Y but with repetition on -1 it don't works. How could i do to achieve that properly ? Thanks function create() { var sprite=[] var tw=[]; for (var i = 0; i < 5; i++) { sprite[i]=game.add.sprite(400+i*10, i*100, 'phaser'); } var move=()=>{ for (var i = 0; i < sprite.length; i++) { //-1 to have perpetual movement but the problem is that onComplete don't works tw[i]=game.add.tween(sprite[i]).to({x:-400},1000,Phaser.Easing.Linear.none,true,i*200) tw[i].onComplete.add(()=>{ //return to right to give the illusion of perpetual movement sprite[i].x=400; // move randomely on y sprite[i].y=Math.random(0,800); },this) } } move(); }
  6. espace

    input on array don't works

    oh my god 🤔 thanks have a good new year
  7. espace

    input on array don't works

    Hi, I have made this sandbox to illustrate that don't works. What is my mistake ? Thanks. //part of snippet function create() { var sprite=[] for (var i = 0; i < 40; i++) { sprite[i]=game.add.sprite(i*10, 0, 'phaser'); sprite.inputEnabled = true; sprite[i].events.onInputDown.add(function(){console.log("clicked")}); } }
  8. Sorry but i don't understand. It 's not possible with combo ?
  9. I forgot to specify i use w2ui.js. here is the doc about the combo :
  10. Hi, I have made this jsfiddle : What i want is add a new item when i press the enter key (see addItem function ). But i can't access to the item with w2ui.js. Wich variable must i use for that in my addItem function ? Thanks for your assist. <!DOCTYPE html> <html> <head> <title>W2UI Demo: fields-3</title> <script src=""></script> <script type="text/javascript" src=""></script> <link rel="stylesheet" type="text/css" href="" /> </head> <body> <div style="height: 10px"></div> <div class="w2ui-field w2ui-span3"> <label>Combo:</label> <div> <input type="combo"> <span class="legend">You can type any text</span> </div> </div> <div style="height: 20px"></div> <style> .w2ui-field input { width: 200px; } .w3ui-field > div > span { margin-left: 20px; } </style> <script type="text/javascript"> var data={ description:["georges","henry"], } var addItem=function(item){ data.description.push(item) data.description.sort(); } $('input[type=combo]').w2field('combo', { items: data.description, }); $( 'input[type=combo]' ).keypress(function(event) { if(event.key == 'Enter'){ console.log( "Handler for .keypress() called." ); ///////////////////////////////////////// //WHAT I WANT TO DO //addItem(something) } }); </script> </body> </html>
  11. Youpppppppppeeeeeeeeeeeeeeeeeeeeeeeeee Success by copy the files under the licenses directory from ~/Android/Sdk/licenses to /usr/lib/android-sdk/licenses. Big thanks to you Milton. Have a nice day.
  12. hi, again problem i have install the build tools and accept the licenses and i have this error below: ./sdkmanager "build-tools;19.0.1" ./sdkmanager "build-tools;26.0.2" ./sdkmanager --licenses All SDK package licenses accepted.======] 100% Computing updates... BUILD FAILED in 1s /home/syst/hello/platforms/android/gradlew: Command failed with exit code 1 Error output: FAILURE: Build failed with an exception. * What went wrong: A problem occurred configuring project ':CordovaLib'. > You have not accepted the license agreements of the following SDK components: [Android SDK Platform 27, Android SDK Build-Tools 26.0.2]. Before building your project, you need to accept the license agreements and complete the installation of the missing components using the Android Studio SDK Manager. Alternatively, to learn how to transfer the license agreements from one workstation to another, go to * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. * Get more help at my requirements is not good also : Android Studio project detected Requirements check results for android: Java JDK: installed 1.8.0 Android SDK: installed true Android target: not installed android: Command failed with exit code ENOENT Gradle: installed /usr/share/gradle/bin/gradle Some of requirements check failed ......
  13. Yes 27.0.1 is missing. I must try on an virtual machine because I don't have any space on my session. I try tomorrow. Could you help me again tomorrow if never ? A big thanks for your assistance.
  14. sure syst@syst:~/hello/platforms/android$ cat build.gradle /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { maven { url "" } jcenter() } dependencies { // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files classpath '' } } allprojects { repositories { maven { url "" } jcenter() } //This replaces w.r.t. build settings project.ext { defaultBuildToolsVersion="27.0.1" //String defaultMinSdkVersion=19 //Integer - Minimum requirement is Android 4.4 defaultTargetSdkVersion=27 //Integer - We ALWAYS target the latest by default defaultCompileSdkVersion=27 //Integer - We ALWAYS compile with the latest by default } } task clean(type: Delete) { delete rootProject.buildDir }