khleug35

Members
  • Content Count

    104
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by khleug35

  1. khleug35

    How to improve Load time?

    About loading times Maybe my code is not compiled well, which causes the loading speed to slow down. I hope anyone can give me an idea to solve the problem. Thanks For example, my game deadgun is 20Mb, My BGM file has 16Mb, so the load time is too slow. In order to avoid initial load time quite slow. I create a Loading Scene for loading asset In Main Scene game.createScene('Title', { .... init: function() { this.choice1 = new game.Button('title/gamestart.png',551,480,function(){ WhatSceneDoYouWantToLoad='StageSelect'; game.system.loadScene('Loading'); }); this.choice2 = new game.Button('title/password.png',836,480,function(){ WhatSceneDoYouWantToLoad='PASSWORD'; game.system.loadScene('Loading'); }); this.choice3 = new game.Button('title/bossfight.png',551,585,function(){ WhatSceneDoYouWantToLoad='StageSelectBoss'; game.system.loadScene('Loading'); }); this.choice4 = new game.Button('title/credits.png',836,585,function(){ WhatSceneDoYouWantToLoad='Credits'; game.system.loadScene('Loading'); }); } .... In Loading Scene game.createScene('Loading', { backgroundColor: "#000000", init: function() { switch(WhatSceneDoYouWantToLoad){ case 'StageSelect': game.addAsset('bgm/shoot1.wav'); game.addAsset('bgm/shoot2.wav'); game.addAsset('bgm/hurt.mp3'); game.addAsset('bgm/jump.mp3'); game.addAsset('bgm/get.mp3'); game.addAsset('bgm/boss_dead.mp3'); game.addAsset('bgm/boom.mp3'); game.addAsset('bgm/boss.mp3'); game.addAsset('bgm/stageselect.mp3'); break; case 'PASSWORD': game.addAsset('bgm/hurt.mp3'); break; case 'StageSelectBoss': game.addAsset('bgm/shoot1.wav'); game.addAsset('bgm/shoot2.wav'); game.addAsset('bgm/hurt.mp3'); game.addAsset('bgm/jump.mp3'); game.addAsset('bgm/get.mp3'); game.addAsset('bgm/boss_dead.mp3'); game.addAsset('bgm/boom.mp3'); game.addAsset('bgm/boss.mp3'); game.addAsset('bgm/stageselect.mp3'); break; case 'Credits': game.addAsset('bgm/shoot1.wav'); game.addAsset('bgm/shoot2.wav'); game.addAsset('bgm/hurt.mp3'); game.addAsset('bgm/jump.mp3'); game.addAsset('bgm/get.mp3'); game.addAsset('bgm/boss_dead.mp3'); game.addAsset('bgm/boom.mp3'); game.addAsset('bgm/stageselect.mp3'); game.addAsset('bgm/Ending.mp3'); break; //stage case 'Stage1': game.addAsset('bgm/stage1.mp3'); break; case 'Stage2': game.addAsset('bgm/stage2.mp3'); break; case 'Stage3': game.addAsset('bgm/stage3.mp3'); break; case 'Stage4': game.addAsset('bgm/stage4.mp3'); break; case 'Stage5': game.addAsset('bgm/stage5.mp3'); break; case 'Stage5-4': game.addAsset('bgm/FinalStage.mp3'); game.addAsset('bgm/finalboss.ogg'); break; case 'Stage5-5-Boss': game.addAsset('bgm/finalboss.ogg'); break; case 'Ending': game.addAsset('bgm/Ending.mp3'); break; //Loading Bar this.bar = new game.Graphics(); this.bar.fillColor = '#ffffff'; this.bar.drawRect(300, game.height/2, 600, 40); this.bar.center(game.scene.stage); this.bar.addTo(game.scene.stage); this.bar.scale.x = 0; this.loader = new game.Loader(); this.loadingtext = new game.SystemText("Loading..."); this.loadingtext.size = 60; this.loadingtext.color = '#ffff68'; this.loadingtext.position.set(490, 250); this.loader.onStart = function() { game.scene.loadingtext.addTo(game.scene.stage); } }; this.loader.onProgress = function() { game.scene.bar.scale.x = game.scene.percent / 100; }; this.loader.onComplete = function() { game.system.loadScene(WhatSceneDoYouWantToLoad); }; this.loader.start(); } but load time seemed quite slow, anyone have good idea or right methed to asset loading?? Thank you very much.
  2. khleug35

    Spaceship 3D game template

    Thanks for this!!!!!!!! you are an absolute legend! I love this. I will build 3D game for my third panda2 game
  3. Hello everyone , I would like to create save game function for my new game. so I using localStorage method, the following is my code, I write the script out of game.modules tab. if(localStorage.getItem("SAVEGAME") === undefined || localStorage.getItem("SAVEGAME") === null){ var savedata =0; localStorage.setItem("SAVEGAME", savedata); }else{ localStorage.getItem("SAVEGAME") } game.module( 'game.main' ) .require( 'game.player' ) .body(function() { game.createScene('Main', { init: function() { var text = new game.SystemText('Hello Panda'); text.size = 36; text.addTo(this.stage); } }); }); The game is not an error. but I Export project to build apk. the editor display this message. how to solve this problem? thank you very much. thx
  4. khleug35

    About write code out of game.modules tab and build apk.

    Oh dxmn !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! I missed Storage Example from https://www.panda2.io/examples#storage-get In Panda2, in order to make save, I don't need to use localStorage it just use game.storage , my problem can solved. here is some example for saving game data game.config = { storage: { id: 'myGame' } }; game.module( 'game.main' ) .body(function() { game.createScene('Main', { init: function() { if(game.storage.get('score') === undefined || game.storage.get('score') === null ){ this.number = 1; game.storage.set('score', this.number); }else{ this.number = game.storage.get('score'); } this.shownumber = new game.SystemText(this.number); this.shownumber.size = 36; this.shownumber.font = 'serif'; this.shownumber.color = '#ff0000'; this.shownumber.align = 'center'; this.shownumber.x = game.width / 2; this.shownumber.addTo(this.stage); } , mousedown: function() { this.number++; game.storage.set('score', this.number); }, update: function() { this.shownumber.text = this.number; }, }); }); @enpu Thanks
  5. khleug35

    About write code out of game.modules tab and build apk.

    @enpu Thanks The following is my Panda 2 log files error code [2019-02-16 17:59:23.389] [error] panda-toolkit error: /Users/admin/Desktop/Game/Burning/src/game/main.js:2 if(localStorage.getItem("Upgrade") === undefined || localStorage.getItem("Upgrade") === null){ ^ ReferenceError: localStorage is not defined at Object.<anonymous> (/Users/admin/Desktop/Game/Burning/src/game/main.js:2:4) at Object.<anonymous> (/Users/admin/Desktop/Game/Burning/src/game/main.js:2757:3) at Module._compile (module.js:571:32) at Object.Module._extensions..js (module.js:580:10) at Module.load (module.js:488:32) at tryModuleLoad (module.js:447:12) at Function.Module._load (module.js:439:3) at Module.require (module.js:498:17) at require (internal/module.js:20:19) at requireScriptTags (/Applications/Panda 2.app/Contents/Resources/app.asar/node_modules/panda-toolkit/build.js:82:13) [2019-02-16 17:59:23.404] [error] panda-toolkit exit: 1 the log display that localStorage is not defined. I think that the localStorage can't put out of game .modules tab. but the game can play on the web, only not work in mobile Any good idea to create the save game function in the game and work on mobile?? Thank you very much
  6. About the joystick plugin problem. Is it possible to make the sprite rotation angle follow by joystick pad position?? if the joystick pad move to right-left, the sprite angle is right-left like the following images The following is my solution, but I think it is not the best way. I create the hidden object and the joystick can control the hide sprite movement. this.gun.rotation= this.gun.position.angle(game.scene.HiddenObject.point.position); like the following image Hidden object class game.createClass('HiddenObject', { init: function() { this.point = new game.Sprite('circle2.png') this.point.anchorCenter(); this.point.alpha =0 this.body = new game.Body(); this.body.collisionGroup = game.Body.POINTER; this.body.collideAgainst= [game.Body.WALL]; this.body.position.x = 500; this.body.position.y = 600; var shape = new game.Rectangle(this.point.width, this.point.height); this.body.addShape(shape); this.body.addTo(game.scene.world); this.body.collide = this.collide.bind(this); var ths = this; }, collide: function(body) { if (body.collisionGroup === game.Body.WALL) { return true; } return true; }, update: function() { if(game.scene.joystick2.axis.x ==0 && game.scene.joystick2.axis.y ==0){ this.body.velocity.x = 0; this.body.velocity.y = 0; } this.point.position.x = this.body.position.x; this.point.position.y = this.body.position.y; this.body.velocity.x += game.scene.joystick2.axis.x * 4800; this.body.velocity.y += game.scene.joystick2.axis.y * 4800; } Rotation Sprite class game.createClass('rotationsprite', { init: function() { this.gun = new game.Sprite('gun.png'); this.gun.anchorCenter(); this.gun.position.set(450, 550); this.gun.addTo(game.scene.container); }, update: function(){ this.gun.rotation= this.gun.position.angle(game.scene.HiddenObject.point.position); } } }); Any idea,? thank, I am sorry about my poor English.
  7. @enpu OH, Thank you very much for this solution, !! I downloaded the example It is more helpful and work for me !!!! thanks again
  8. khleug35

    [Panda2] Dead Gunner

    Hello Everyone. My new HTML5 platormer game made using Panda2, this is my first Panda2 game, it is very good html5 engine, I am very enjoy to use it This game can play on mobile or desktop Special thanks to @Wolfsbane and @enpu teaching me coding skill, really thanks try the game in here : https://superfranco.itch.io/dead-gunner Full Gameplay Update: 2018-01-11 -Add checkpoint to Stage1-2 -Change the shoot button and jump button positions Update: 2018-01-06 -New Android version, you can download the game from google play. Google Store Link -add an explosion when the player dies by enemies -add arrow instruction for each stage. -improved the initial load time, and add a loading screen -Bug fix Screenshot Password Stage1 clear- 1234 Stage1 && Stage2 clear- 5678 Stage1 && Stage2 && Stage3 clear- 9981 Stage1 && Stage2 && Stage4 clear- 1516 Stage1 && Stage3 clear- 3412 Stage1 && Stage4 clear- 6666 Stage2 clear- 2234 Stage2 && Stage3 clear- 3274 Stage2 && Stage3 && Stage4 clear- 4234 Stage2 && Stage4 clear- 5734 Stage3 clear- 9527 Stage3 && Stage4 clear- 1314 Stage4 clear- 9991 Stage1 && Stage2 && Stage3 && Stage4 clear- 0964 Final Boss Fight- 0007 thank you for your playing, hope you enjoy __________________________________________________________________________________________________________________________________ Control Left key - Left Run Right key- Right Run Up - Up direction Z Key - Shoot X or Space Key- Jump Hold Up key and press down Z Key - Up Shoot P key - Pause Game R key - Quit game( Pause mode) Gracphic Designer: Surt https://opengameart.org/users/surt https://opengameart.org/content/dead-gunner and some Gracphic download from https://opengameart.org/ Game Music: All music use by Kenyuu Densetsu Yaiba(Game Boy) game Present by Banpresto Takashi Horiguchi Game Engine: Panda2 https://www.panda2.io
  9. khleug35

    [Panda2] Dead Gunner

    @ShrewdPixel Thank you for your suggestion and thank you for playing Your comment is very helpful to make improve my game quality to my next game. Thank you for play all game to Game Showcase Pages and leave a more useful comment to each developer, thanks , have a nice day!
  10. khleug35

    [Panda2]Make 10! - A card game for Android.

    Very awnsome game!!!! Good Job, Great work!!! I Can't Stop Playing It,
  11. khleug35

    Creating desktop app with Panda 2

    Great Jobs, Thank for the update
  12. khleug35

    How to improve Load time?

    @enpu Thank you for reply and suggestion. TinyPNG and TexturePacker is a nice, simple to compress images online, thx
  13. khleug35

    How to improve Load time?

    @Wolfsbane Thx for reply The reason for I doing each scene load. I hope I don't want to load all asset in the main scene(it will case initial load time quite slow) so I doing each scene load. I tested it, when the game load the assets for each one time. the second time very too fast, so I think when the system load the assets one time, It will not load the asset again every time.
  14. khleug35

    How to improve Load time?

    Hello, @enpu I have received feedback, my new game in android app's load time slow and it can be improved. I take a video for reference. https://www.youtube.com/watch?v=WWN6Zc5ceug for my phone 0:00 - 0:02 The initial load time is taken 2sec. 0:04 - 0:09 Stage Select load time is taken 5sec. 0:10 - 0:12 Stage 1 load time is taken 2sec. 2:56 - 2:58 Stage 2 load time is taken 2sec. 5:12 - 5:14 Stage 3 load time is taken 2sec. 8:20 - 8:23 Stage 4 load time is taken 3sec. 12:27 - 12:29 Final Stage load time is taken 2sec. 15:41 - 15:46 Final Stage 2 load time is taken 5sec. For me, I think that the load time is not very very slow, but is it possible to improve??? thank you very much
  15. khleug35

    [Panda2] Dead Gunner

    @enpu Thank you,have a nice day @Wolfsbane Many Thank you for a great point I have asked the question about load time in panda2 forum and I will change button positions and add check point in Stage1-2 to next version Thanks again, have a nice day
  16. khleug35

    Block Puck 3D game template

    Woooo😍, Great Job, thank for this
  17. khleug35

    12 MiniBattles (Available for Non-Exclusive License)

    Great Game , it would be fine to battle with CPU
  18. khleug35

    Eternity Pilot

    Great game!!! very fun, I very enjoy getting an infinity gun and bomb
  19. khleug35

    Fallgate – A tiny 2D adventure game

    Great Game!!!!
  20. khleug35

    [Panda2] Dead Gunner

    Update: 2018-01-06 -New Android version, you can download the game from google play. Google Store Link -add an explosion when the player dies by enemies -add arrow instruction for each stage. -improved the initial load time, and add a loading screen -Bug fix
  21. Nice! Well done! Your score 10 / 15
  22. khleug35

    [Panda2] Dead Gunner

    @Wolfsbane Thank you for playing I agree with you, the initial load time seemed quite slow My Game is 20mb and the music file is 15mb I guess I need to learn the loader skill at panda2.io, thx
  23. Hello everyone and happy new year. I am very happy to create my new HTML5 platformer game made using Panda2. http://www.html5gamedevs.com/topic/41924-panda2-dead-gunner/ I tried to use Panda2 to build apk file and publish this to play store, finally, I unsuccessful The following is my step Firstly, I follow the tutorial to create keystore https://support.magplus.com/hc/en-us/articles/204270928-Android-Kindle-Fire-Creating-a-Keystore-File http://docs.phonegap.com/phonegap-build/signing/android/ Here is my code keytool -genkey -v -keystore super-key.keystore -alias superalias -keyalg RSA -keysize 2048 -validity 1000 After i have created my keystore file(super-key.keystore) and place it at the root of my project folder and fill in the input field to the Android Signing settings: and click 'Build' button Panda2 is built the release.apk successfully. but when I upload to play store, it still displays debuggable error Do I need to create a config.xml file and type this script android:debuggable="false" on it??? or I missed a step??? Thank you so much. thanks
  24. khleug35

    XMAS PUZZLES [HTML5]

    Great Game!!!!! I love your graphics
  25. khleug35

    Coyote

    Very funny game, I love it, the animals is cute