Search the Community
Showing results for tags 'Cocoon'.
-
Hey all, Right now, Ludei Cocoonjs doesn't load and parse XML files... Which means that we can't load bitmap font data. I am wondering if anyone else has figured out a workaround to this issue?
-
First time to upload ios app. After I uploaded my ipa file for testflight It has an error that says the binary has no icon of 1024x1024 but it successfully uploaded and tested on testflight. The ipa file is compiled from cocoon in which I provided an icon of 1024x1024 before compiling. Thanks in advance.
-
Now that apple's requirements to submit a new app is to have an iphone X screenshot, how can I take a screenshot of my app packed with cocoon?
-
Hello, I'm trying to make a mobile version of a game. The game has lots of code and javascript files that I preload (I have a bootstrap file, that load the splash screen and preloader). I load the scripts like this: game.load.script('preload', 'Preload.js'); It works perfectly on the browser and with the Webview mode in Cocoon, but when I try to use Canvas+, I get an error when I try using the contents of "Preload.js". Not even a problem when trying to load it, so I don't even know why it's happening. Does anyone know what it could be? I would like to use Canvas+, since the webview is a bit slow. Thank you!
-
Hi All, I just released my new game Blassty. It is really fun and addictive puzzle game. I made the game using Phaser Game Framework and wrapped into apk using Cocoon. It is totally free. No ads or something. Gameplay: You need to connect at least 3 blocks to pop them up in 4x4 grid. I hope you enjoy Blassty Google Play Link: https://play.google.com/store/apps/details?id=com.mussky.blassty
-
Hello world! Just realeased my first Phaser + Cocoon game. https://play.google.com/store/apps/details?id=com.boboalegre.chipchipcrap It is really a basic starter (side-)project but I'm quite happy how it came out. I plan to continue upgrading things so I'd really appreciate any suggestion/feedback. Hope you give it a try! Have a great day!
-
Hi everybody, To thank the users of this forum who helped me a lot, i put my template available to help new beginners or someone else. This template offers : correct scaling without stretching effect portrait mode (for landscape mode you must invert width and height) works with cocoon in webview+ and canvas+ mode (deviceready implemented) upload the file source.zip in cocoon.io and run it. https://cocoon.io/ NOTICE for canvas+, avoid this syntax, that don't work in canvas+, in webview and webview+ no problem let variable; const anothervariable; var myFunc=()=>{} and prefer this: var variable; var myFunc = function(){}; simple example with prototype and inheritance use the states (i personnaly put all the states in a single file but you can quite put them in separate files, it's necessary to inform them in index.html eg: <script src="src/otherfile.js"></script> This template is based on : https://github.com/EnclaveGames/Cyber-Orb and how to adjust the scale is based on: Now my template for the beginners , index.html <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>example_test_scale</title> <link rel="shortcut icon" href="favicon.png" type="image/x-icon" /> <style> body { margin: auto; display: table; position: absolute; border:0px; top: 0px; left: 0px; padding: 0; margin: 0; background: #ffff00 } </style> <!--necessary for cocoon.js--> <script src="cordova.js"></script> <script src="src/phaser.js"></script> <script src="src/main.js"></script> </head> <body> </body> <script> document.addEventListener("deviceready", function() { setTimeout(function() { navigator.splashscreen.hide(); }, 5000, false); }); (function() { //start with a game with these resolution : 1280-1920 // personnaly i find it offers the best graphics for all devices but may slow some devices. // after put a safe zone //1280+200 > 1480 //1920 +350 > 2270 (350 is 200*1.5 > ratio from 1920/1280) var safe_zone_width=1480; var safe_zone_height=2270; var w = window.innerWidth ;//* pixelRatio, var h = window.innerHeight ;//* pixelRatio; var lw, lh; if ( h > w ) { lw = h; lh = w; } else { lw = w; lh = h; } var aspect_ratio_device = lw/lh; var aspect_ratio_safe_zone = safe_zone_height / safe_zone_width; var extra_height = 0, extra_width = 0; if (aspect_ratio_safe_zone < aspect_ratio_device) { // have to add game pixels horizontally in order to fill the device screen extra_height = aspect_ratio_device * safe_zone_width - safe_zone_height; } else { // have to add game pixels vertically extra_width = safe_zone_height / aspect_ratio_device - safe_zone_width; } game = new Phaser.Game( safe_zone_width + extra_width, safe_zone_height + extra_height, Phaser.CANVAS, 'game'); game.state.add('boot', boot); game.state.add('preloader', preloader); game.state.add('the_game', the_game); game.state.add('next_screen', next_screen); game.state.start('boot'); })(); </script> </html> my main.js //initialize variables here var test="1...2...3"; var text="hello from sprite"; //example of prototype => a simple sprite _sprite = function(game,posx,posy,picture){ this.picture=picture, this.posx=posx; this.posy=posy; //call the class sprite from Phaser Phaser.Sprite.call(this,game,this.posx,this.posy,this.picture); this.anchor.setTo(0.5,0.5); game.add.existing(this); }; _sprite.prototype=Object.create(Phaser.Sprite.prototype); // say hello from sprite _sprite.prototype.say_hello=function(){ alert(text); }; //use another prototype but with the previous parameter from _sprite, it's inheritance _super_sprite=function(game,posx,posy,picture,super_power){ //call the first prototype _sprite.call(this,game,posx,posy,picture); this.super_power=super_power; this.scale.setTo(2,2); }; _super_sprite.prototype=Object.create(_sprite.prototype); // add a new characteritic to this prototype _super_sprite.prototype.show_super_power=function(){ alert(this.super_power); }; var boot = { preload: function() { }, create: function() { //to scale the game this.game.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL; this.game.scale.pageAlignHorizontally = true; this.game.scale.pageAlignVertically = true; //red color to see the background of the game itself // you must change the background in the index.html to have the same color in the background game // > change the yellow in red it's only to see how the game is scalling this.game.stage.backgroundColor = '#ff4000'; this.game.scale.refresh(); this.game.state.start('preloader'); }, }; var preloader = { preload: function() { this.load.image('green_circle', 'img/green_circle.png'); this.load.image('white_circle', 'img/white_circle.png'); }, create: function() { this.game.state.start('the_game'); //do not use arrow function like this var some_function=()=>{alert(test)} //it works on webview+ mode but not on canvas mode var some_function=function(){ alert(test); }; some_function(); } }; var the_game = { create: function(){ //to center an object in your game use this: this.green_circle = this.add.sprite(this.game.world.centerX,this.game.world.centerY,'green_circle'); this.green_circle.anchor.setTo(0.5,0.5); this.game.add.existing(this.green_circle); this.game.time.events.add(2000,function(){this.game.state.start('next_screen');},this); //use prototype => sprite with white_circle this.white_circle=new _sprite(game,this.game.world.centerX,1800,'white_circle'); this.game.time.events.add(1000,function(){this.white_circle.say_hello();},this); //use another prototype with inheritance this.super_white_circle=new _super_sprite(game,this.game.world.centerX,1500,'white_circle','i am superman'); this.game.time.events.add(1500,function(){this.super_white_circle.show_super_power();},this); this.game.time.events.add(1800,function(){this.super_white_circle.say_hello();},this); }, }; //for the next screen => next state, the green_circle move to top and alpha is minder var next_screen = { create: function(){ console.log("next"); this.green_circle = this.add.sprite(this.game.world.centerX,300,'green_circle'); this.green_circle.anchor.setTo(0.5,0.5); this.green_circle.alpha=0.5; this.game.add.existing(this.green_circle); }, }; And finally you could download all the template below(template.zip). To launch the app, go to template/www/index.html or upload the file template.zip in cocoon.io and run it. https://docs.cocoon.io/article/developer-app/ Enjoy ! ps liste of tools i use : image editor => https://www.gimp.org/fr/ vector image => https://inkscape.org/fr/ font to image => http://kvazars.com/littera/ convert music to ogg => https://audio.online-convert.com/fr/convertir-en-ogg reduce png => https://tinypng.com/ particle editor => https://phaser-particle-editor.firebaseapp.com/ text editor the best => https://neovim.io/doc/user/nvim.html plugin with nvim : Plug 'scrooloose/nerdtree' Plug 'morhetz/gruvbox' Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } Plug 'Raimondi/delimitMate' Plug 'rhysd/github-complete.vim' Plug 'easymotion/vim-easymotion' Plug 'terryma/vim-multiple-cursors' Plug 'vim-syntastic/syntastic' Plug 'kien/ctrlp.vim' Plug 'majutsushi/tagbar' Plug 'pangloss/vim-javascript' Plug 'vim-scripts/indenthtml.vim' Plug 'walm/jshint.vim' syntax style correct => http://jshint.com/ colorscheme => https://github.com/joshdick/onedark.vim os : awesome wm on linux with zsh an interesting link to review the basis from javascript in 5 minutes > https://learnxinyminutes.com/docs/javascript/ template.zip
-
I've just made my first builds using Cocoon by Ludei. I've used Phaser/javascript to make the app. I started making some notes to aid me in the future as I don't make many app build builds and I'll have forgotten by the next time I do. I decided to put it here as it may help others. There isn't anything here that isn't available on Cocoon's docs, forums, and a few other places on the web but they are snippets that I wish had been in big red letters when I was working through it. Follow Cocoon's docs. What's written here is essentially the solutions/extra clarity to each sticking point I had. Include this line between the head tags of your index.html. (Code taken from Cocoon's docs) <script src="cordova.js"></script> include this in your body tags. <script type="text/javascript"> document.addEventListener('deviceready', function() console.log("Cordova is initialized and ready!"); }, false); </script> I start my game using the following code in index.html. I tried using the anonymous function as shown in a Phaser Cocoon template but this caused subtle changes to my game. I could not find what the cause was as it seemed utterly unconnected and, although I presume it must be to do with scope, impacted things that were scoped only to a single state. Essentially a Phaser group was no longer updating its children as it was expected to. Be sure to check your game carefully using the developer build as these new bugs can be subtle. I used the following. Uncommenting the first and last lines as in the template still seems to work but introduces those subtle bugs. <script type="text/javascript"> //(function(){ var game = new Phaser.Game(2048, 1536, Phaser.AUTO, 'game'); game.state.add('Boot', BasicGame.Boot); game.state.add('Preloader', BasicGame.Preloader); game.state.add('Game', BasicGame.Game); game.state.add('OtherState', BasicGame.OtherState); game.state.start('Boot'); //})(); </script> Create file structure of js assets src css index.html Zip these files *not* the folder they are in. See zip gotcha below. The bundle id you use in the cocoon builder must not have uppercase letters even though you may have already created a bundleid with apple that you cannot change. Fortunately, if you were stupid enough (me) to have done this a long time ago, it does not seem to matter that they do not match, Apparently Apple, at least, is case insensitive for bundle ids. FOr iOS, if you wish to test the resulting ipa on a device, build it using a development certificate and an adhoc provisioning profile. (Not a development provisioning profile/ensure your devices are added to your dev account before generating the provisioning profile). Just copy the ipa to iTunes and then to the device. Quirks that may be resolved in future updates: The zip file that you create of your project won't work if you use the the native Windows 'send to archive' using winrar results in a zip that does work. The help links accompanying each section are very useful. A minority, however, open in the current window so losing any changes you've made. Best to 'open as new window' just in case. Conclusions I have to say, the service was very good. Aside from the few issues mentioned above it went very smoothly. Uploading a single icon and having the service sort it into the myriad that Apple demands was a bonus time saver. For me, it was a much nicer process than when I used xcode and cordova alone. I've used the free service with a very small app (less than 5mb). I've had to use the webview+ as one section of my app uses the DOM but the performance is still very good. My app has a lot of sprites on screen but they don't update much. Only the zip issue was nearly a showstopper. Whether this is an issue with Microsoft's archiver or Cocoon's reading of the zip I don't know but it was the only problem I found that really needs to be addressed with urgency. The value of Cocoon's service will vary for you, but I'll definitely be considering the paid for version when I'm ready for its extra features.
-
Hi All, I have just released my new game Tap-Jet on Play Store. Tap-Jet is a simple addictive game with easy gameplay. I used Phaser Game Framework with p2 physics engine and wrapped into Android game using Cocoon. Google Play Link: https://play.google.com/store/apps/details?id=com.mussky.tapjet I hope you will like Tap-Jet!
-
i am new in phaser and successfully made a game.But the problem i faced is when i compile it with phone gap or intel XDK the the phone button like backbutton doesn't work properly.The whole game exit in one press of back button. I want to use a confirmation massge like "Do you want to exit " like general app does.After conformation the game will exit.How can i do this?...It will be very kind of you and helful if you answer ...Thanks in Advance.
-
hi, i want to allow these permissions in android : android.permission.INTERNET android.permission.ACCESS_NETWORK_STATE android.permission.WRITE_EXTERNAL_STORAGE android.permission.ACCESS_WIFI_STATE android.permission.READ_PHONE_STATE I think that i couldn't write permissions with an androidmanifest.xml in cocoon.io but the permissions is allow by plugins.... So which plugin(s) do i use in cocoon for allow this ? thanks for your help.
-
- cocoon
- permissions
-
(and 1 more)
Tagged with:
-
Hello Everyone! I'm so glad to present multiplatform game, which is playable through Android smartphones/tablets and Facebook. Technology stack: Apache Cordova, Cocoon, HTML5 Audio, Local Storage, Phaser. Integrations: Sharing, inviting friends, Admob, In-app purchases - for both versions, Android and Facebook. Link to game post: https://doyban.com/cashninja/ Direct link to Google Play: https://play.google.com/store/apps/details?id=com.doyban.cashninja Direct link to Facebook: https://apps.facebook.com/cash-ninja/ Looking for feedback, positive and negative, especially for bugs Ahh, didn't want to spam here with images, screenshots are visible through the first link to game post, HTTPS secure connection. Thanks!
-
- phaser
- facebook game
-
(and 4 more)
Tagged with:
-
hi, after trying a lot (+/-50) of compilations with cocoon.io and without success...i go to you dear forum i take screenshoot of what i do to see with you if i'm doing something wrong. 01 : i choose guided creation and select Phaser template 02 : choose canvasplus mode 03: let the defaults options 04: my project appears 05: download the source code (source.zip) for ensure that it works i extract this and test and i see the cyber orb demo with the index.html 06:upload the source.zip and update the project with these source 07: select the platform android 08: save my changes 09: compile the dev app (the rockect) 10: download the dev app Install it on my phone..the install goes without bug ( i allow all the permissions) but when i launch the application crash instantanely. with adb logcat i collect this information : 05-12 21:15:14.625 4498 5561 W PGMiddleWare: in handleAction, invoke client = com.huawei.pgmng.middleware.AudioEffectLowPowerImpl@abaff48, action = com.huawei.pgmng.PGAction@3cf199a actionId =10000 pkg =io.cocoon.template.phaser.orb extend1 =1693 extend2 = flag =3 type =1 i test also on other phone and same result. If i take the dev app from the playstore and select the source.zip everything is ok. i have also test selecting all the plugin core, save and compile and same result. On the forum on cocoon.io no response to my questions.... in the past i success to compile a dev app and use it for test my applications but now I can not get anything. Help from you would be more than welcome if i miss something to say ask me... Thanks....
-
- compilation
- phaser
-
(and 1 more)
Tagged with:
-
Hi, I have created a game in Phaser and it runs file on my local machine via XAMPP. I have reshuffled my files to align to the Cocoon structure as per their example (basically just used the default Cocoon template, switched out a few files and editor the config.xml file with my own params), successfully compiled the app via Cocoon.io cloud service and created the .ipa file which I have put onto my device (the iPad mini). However, when I run the file I get a black screen. I downloaded and installed the developer app on my iPad and dropped my zipped game into it. Then I ran the game via canvas+ and got these errors - the first when I run the app, the ones in red when I look at the debug. Any ideas what is going on? Completely at loss on this one. Max.
-
I have been able to successfully build and run my game on mobile using cocoon.io but now I want to put in some ads. Unfortunately, I've been unable to get that working on my own. within the boot state I have the following code boot.init = function () { ... this.game.device.whenReady(function(){ if(this.game.device.cordova) { if(typeof Cocoon.Ad.AdMob !== 'undefined' && Cocoon.Ad.AdMob) { this.setupAdmob(); } } }) }; boot.setupAdmob = function() { var admobSettings = {}; admobSettings = { interstitial: 'my-admob-id' }; Cocoon.Ad.AdMob.prepareInterstitial({ adId: admobSettings.interstitial, autoShow: false, isTesting: true }); } then within the game state, I have the following game.gameOver = function () { Cocoon.Ad.AdMob.showInterstitial(); this.ball.body.velocity.setTo(0, 0); this.introText.text = 'Game Over!'; this.introText.visible = true; this.time.events.add(Phaser.Timer.SECOND * 4, function() { this.state.start('game'); }, this); }; I also have cordova.js included in my index.html, I think that is all I should need. The game state order goes from menu > boot > preloader > game. It is displaying the menu but won't go anywhere beyond that. I'm not sure if it is the menu itself that is frozen or if it is hanging up in boot or preload before getting to the game state. Because this is on my phone I don't see any debug errors or anything. It is just frozen. Can anyone see what I am doing wrong?
-
Hello guys, I'm struggling to vertically center my Phaser game inside Cocoon IO wrapper. In the browser it's all centered both horizontally and vertically but when I load it into Cocoon the game is aligned top. My setup: - html & body tags' height property is set to 100% - I don't have a div containing the canvas element, I let Phaser handle the creation of the canvas. - In the Boot state I use: this.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL; this.scale.pageAlignHorizontally = true; this.scale.pageAlignVertically = true; this.scale.refresh(); For some reason, though my screen is 1920 x 1080, and the canvas been displayed like this: <canvas width="480" height="800" style="display: block; touch-action: none; user-select: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); width: 1080px; height: 1800px; cursor: inherit; margin-left: 0px; margin-top: 60px; margin-bottom: -60px;"></canvas> I end up in Cocoon with the game align to the top of the screen and the 120 extra pixels in the bottom and not distributed equally on the top and bottom of the game. Any advice on this? Thanks!
- 11 replies
-
Hi, Has anyone had success implementing IAPs for iOS using Cocoon? I'm currently using the atomic plugin for IAP from https://github.com/ludei/atomic-plugins-inapps. The API seems to work as it should, but I always get "invalid products" when requesting products from my iOS app. The products are correctly set up in my iTunes Connect account, and in the "Ready to Submit" phase. I’ve also created a TestFlight build but the plugin still gets the “Invalid Products” response. I've posted on both Cocoon's forums -https://forums.cocoon.io/t/trouble-getting-iaps-to-work-on-ios/4936 - and the issues section of the plugin github page - https://github.com/ludei/atomic-plugins-inapps/issues/11 - and am waiting to hear back. Our game is in Phaser so I thought I'd reach out to the html5 dev community to see if anyone has run into similar problems. Any insight would be greatly appreciated! Thanks, Galen
-
Hi, we have recently released Fallin for Android and iPhone/iPad. Please have a look, we are happy about any feedback Fallin for iPhone and iPad: App Store Fallin for Android devices: Play Store You can also follow us at: FACEBOOK TWITTER or visit our website: http://www.iwantanelephant.com/
-
Christmas is coming Our new game is released since yesterday We wish you a merry christmas and a happy new year! See you in 2017! Assist Santa in delivering gifts to all the children in this challenging race. Only a few days left until Christmas eve. Santa is a little late in delivering all the gifts. Help him collect and deliver the gifts directly to the waiting children and to create a bright smile on their faces. Being Santa is not easy. You will need some practice to get it right. Apple: http://apple.co/2hZYJYh Android: http://bit.ly/2hYqQak Features: Hard to master Challenging to play Unique gameplay Share your highscore Endless game mode How to play: Invisible elves continuously place gifts on your playing field Click to add them to Santa's sleigh Click on Santa to drop a gift and drag it in the direction of a chimney Keep the collected and the successfully delivered gifts in perfect balance
-
Hello, I'm trying to call the keyboard on click (InputDown) event. Everything works fine in Android, but on iOS the keyboard doesn't show. I'm running the app through Cocoon Developer App using .zip file openKeyboard: function() { Cocoon.Dialog.showKeyboard({ type: Cocoon.Dialog.keyboardType.TEXT, }, { insertText: function(inserted) { console.log(inserted); }, deleteBackward: function() { console.log("deleteBackward"); }, done: function() { console.log("user clicked done key"); }, cancel: function() { console.log("user dismissed keyboard"); } }); } showKeyboard function is called because I've checked that using console logs, but actual keyboard is not appearing... Anyone encountered simillar problems? Or maybe you can recommend some other option to display keyboard in native app?
-
After years of focusing on my full time job, I was finally able to complete my first game with an ex-colleague designer / friend of mine. The game is called Mr Okada and it is based in Lagos, Nigeria where I grew up for the first 20 years of my life. The game was created with phaser and packaged with cocoon. It is basically a simple swipe up and down game to pick up items/passengers and avoid other vehicles, with a bit of a background story of the main character. http://www.bisonplay.com/media
-
I'm trying to build a native app with cocoon and canvas+ and have some trouble with the fonts. Everything works fine when running the game in a normal browser or in cocoon webview+. But in canvas+ mode, all text renders really small and pixelated. The code for the text: this.scoreText = this.game.add.text(pos.x, pos.y, "0", { font: "18px Arial", fontWeight: 'bold', fill: "#FFFFFF" }); this.scoreText.anchor.setTo(0.5, 0); I don't reference a .ttf or anything. Do I explicitly need to include an Arial font for it to work in canvas+ mode?
-
Hi All, I have released my new game Gravity Swipe. Here: Gravity Swipe Gameplay is simple, swipe to change gravity direction to move the ball and collect green feeds and avoid from red stars. I am waiting for your reviews. Thanks. Screenshots:
-
Word Crash is a fast-paced, physics-based word game for iOS and Android. It's kind of like tetris with letters. It's made in Phaser and packaged in cocoon.io as a native app. You can try it for free here: http://onelink.to/tw23cx