Search the Community
Showing results for tags 'xml'.
-
Hey, I am trying to use a texture atlas that comes with xml and not json. its actually one from kenny nl's free assets, which seems to come with xml only. i cant find a phaser example which loads an xml, and if i convert the xml to a json using an online converter, the json is formatted wrong ( " Atlas JSON Hash given, missing 'frames' Object" ) thanks
- 2 replies
-
- texture atlas
- json
-
(and 1 more)
Tagged with:
-
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?
-
I'm using the latest bjs alpha, a few old errors disappeared (fixed I guess), and new ones appeared. These are internal bjs errors that are not related to my code as far as I can tell. 1) I don't know what this is related to. 2) This error is logged for each .babylon file I'm loading. Why am I getting an XML parsing error on a .babylon file written in JSON format?
-
I remember someone built an extension for Babylon.js where you could use XML tags instead of javascript to build the scene. I've checked the forums and can't find any mention of it anymore. Does anyone remember what it was called? I want to try it out again.
-
Hi! This is my first time creating a game via a tutorial which I've coded along with so I am a completely new at this but I am eager to learn. I've this game "Bunny Defender" and want to create a simple High Score which I can store in some kind of localstorage with ex XML and display the high score result out on the screen when the game is over. I don't know how to do this and where to start. Would be very thankful if someone could point me at the right direction and how to manage this? // The complete game online http://rewindlevel.net/ // All the game files on github https://github.com/eiffelqiu/bunny-defender /Rookie Boy
- 7 replies
-
- phaser
- localstorage
-
(and 1 more)
Tagged with:
-
Hi there, I am currently using Phaser for a University assignment and absolutely love it! Despite this I am having an issue trying to get a sprite atlas to work. I have created a sprite sheet and corresponding atlas using shoebox and I am loading it into the game like so: game.load.atlasXML('bee', 'assets/images/bee/beeAtlas.png', 'assets/images/bee/beeAtlas.xml');I think everything is working fine at this point. Then within my Bee object I am doing the following: this.sprite = game.add.sprite(50, 50, 'bee');this.sprite.animations.add('fly', Phaser.Animation.generateFrameNames('fly', 1, 11, '', 2), 30, true);this.sprite.animations.play('fly');For some reason this isn't working and I am getting the error: TypeError: 'null' is not an object (evaluating 'this.currentFrame.uuid')Has anyone got any idea why this might be? I should note that I been able to get animation working fine without an atlas, but I would like to use an atlas now so I can switch easily. I have attached the sprite sheet and atlas as well for you to take a look. Thanks in advance! beeAtlas.xml
-
Hello, I want to read data and properties from xml file in my game. I have already loaded the xml file in preloader using preload: function () { game.load.xml('xml', 'some_xml.xml', false); },I know that I can get it using cache.getXml(); but the question is... how to read data, properties from that xml? Some simple example will be great. Another questions : Is using xml file to store data (lots of text, nodes) a good idea? Would it work when making native app for android/ios using cocoon? I have found some old post that reading xml was not supported in cocoon, didnt find info if it has changed. If using xml is bad, what is the solution then? json?
- 4 replies
-
- xml
- processing xml
-
(and 3 more)
Tagged with:
-
Hello, I'm trying to use the TexturePackerGUI i have generated the spritesheet and a XML archive, when i test my game. This happen: Phaser.Loader - textureatlas[sprites]: Unexpected token <Phaser.Cache.getImage: Key "sprites" not found in Cache.Cannot set frameName: bonecoandando1.png Code o my Game:mapa.prototype = { create: function () { var tempodejogomapa = 0 if(niveldisponivel == 1){mapa = game.add.sprite(0,0,"mapa");} if(niveldisponivel == 2){mapa = game.add.sprite(-800,0,"mapa");} if(niveldisponivel == 3){mapa = game.add.sprite(-1600,0,"mapa");} if(niveldisponivel == 4){mapa = game.add.sprite(-2400,0,"mapa");} player = game.add.sprite(625,440 ,'sprites', 'bonecoandando1'); game.physics.arcade.enable(player) if(niveldisponivel == 2){player.reset(523,440)} if(niveldisponivel == 3){player.reset(523,123.5)} if(niveldisponivel == 4){player.reset(191,123.5)} if(niveldisponivel == 5){player.reset(105,123.5)} if(vjoyon){ game.vjoy = game.plugins.add(Phaser.Plugin.VJoy); game.vjoy.inputEnable(0, 0, 800, 600); buttonp = game.add.button(740, 550, 'botaopulo', this.pular, this, 2, 1, 0); buttonp.fixedToCamera = true;} }, update: function () { if(player.position.x < 523 && nivelmapa == 1){player.body.velocity.x = 0;player.reset(523,440);} if(player.position.y < 123.5 && nivelmapa == 2){player.body.velocity.y = 0;player.reset(523,123.5);} if(player.position.x < 190 && player.position.x> 180 && nivelmapa == 3){player.body.velocity.x = 0;player.reset(191,123.5);} if(player.position.x < 105 && nivelmapa == 4){player.body.velocity.x = 0;player.reset(105,123.5);} if(player.position.x > 625 && nivelmapa == 0){player.body.velocity.x = 0;player.reset(625,440);} if(player.position.y > 440 && nivelmapa == 1){player.body.velocity.x = 0;player.reset(523,440);} if(player.position.x > 523 && nivelmapa == 2){player.body.velocity.x = 0;player.reset(523,123.5);} if(enterButton.isDown){ if(nivelmapa == 1 && player.position.x == 523 && player.position.y == 440){game.state.start('nivel1');} if(nivelmapa == 2 && player.position.x == 523 && player.position.y == 123.5){game.state.start('nivel2');} if(nivelmapa == 3 && player.position.x == 191 && player.position.y == 123.5){game.state.start('nivel3');} if(nivelmapa == 4 && player.position.x == 105 && player.position.y == 123.5){game.state.start('nivelfinal');} } }, pular: function(){ if(nivelmapa == 1 && player.position.x == 523 && player.position.y == 440){game.state.start('nivel1');} if(nivelmapa == 2 && player.position.x == 523 && player.position.y == 123.5){game.state.start('nivel2');} if(nivelmapa == 3 && player.position.x == 191 && player.position.y == 123.5){game.state.start('nivel3');} if(nivelmapa == 4 && player.position.x == 105 && player.position.y == 123.5){game.state.start('nivelfinal');} },XML code: <?xml version="1.0" encoding="UTF-8"?><!-- Created with TexturePacker http://www.codeandweb.com/texturepacker--><!-- $TexturePacker:SmartUpdate:e433778311e7731d97964fb86e05b046:1/1$ --><!--Format:n => name of the spritex => sprite x pos in texturey => sprite y pos in texturew => sprite width (may be trimmed)h => sprite height (may be trimmed)oX => sprite's x-corner offset (only available if trimmed)oY => sprite's y-corner offset (only available if trimmed)oW => sprite's original width (only available if trimmed)oH => sprite's original height (only available if trimmed)r => 'y' only set if sprite is rotated--><TextureAtlas imagePath="sprites.png" width="512" height="1024"> <sprite n="agua0001.png" x="438" y="199" w="14" h="31" oX="0" oY="4" oW="31" oH="18" r="y"/> <sprite n="agua0002.png" x="500" y="364" w="9" h="32" oX="0" oY="8" oW="32" oH="17" r="y"/> <sprite n="agua0003.png" x="498" y="198" w="12" h="32" oX="0" oY="4" oW="32" oH="16" r="y"/> <sprite n="agua0004.png" x="304" y="98" w="15" h="32" r="y"/> <sprite n="agua0005.png" x="405" y="199" w="15" h="31" r="y"/> <sprite n="balao.png" x="304" y="199" w="99" h="54"/> <sprite n="bandeira1.png" x="2" y="254" w="300" h="50" r="y"/> <sprite n="bandeira2.png" x="2" y="202" w="300" h="50" r="y"/> <sprite n="bandeira3.png" x="2" y="150" w="300" h="50" r="y"/> <sprite n="bandeira4.png" x="2" y="98" w="300" h="50" r="y"/> <sprite n="barrahp1.png" x="2" y="82" w="320" h="14"/> <sprite n="barrahp2.png" x="2" y="66" w="320" h="14"/> <sprite n="barrahp3.png" x="2" y="50" w="320" h="14"/> <sprite n="barrahp4.png" x="2" y="34" w="320" h="14"/> <sprite n="barrahp5.png" x="2" y="18" w="320" h="14"/> <sprite n="barrahp6.png" x="2" y="2" w="320" h="14"/> <sprite n="base.png" x="405" y="232" w="97" h="96" r="y"/> <sprite n="body.png" x="324" y="2" w="160" h="160"/> <sprite n="bonecoandando1.png" x="237" y="700" w="62" h="28" r="y"/> <sprite n="bonecoandando2.png" x="306" y="693" w="62" h="34" r="y"/> <sprite n="bonecoandando3.png" x="173" y="693" w="62" h="34" r="y"/> <sprite n="bonecoandando4.png" x="242" y="664" w="62" h="34" r="y"/> <sprite n="bonecoandandofrente1.png" x="2" y="751" w="62" h="35" r="y"/> <sprite n="bonecoandandofrente2.png" x="66" y="728" w="62" h="35" r="y"/> <sprite n="bonecoandandofrente3.png" x="2" y="714" w="62" h="35" r="y"/> <sprite n="bonecoandandotras1.png" x="68" y="691" w="62" h="35" r="y"/> <sprite n="bonecoandandotras2.png" x="136" y="676" w="35" h="62"/> <sprite n="bonecoandandotras3.png" x="178" y="656" w="62" h="35" r="y"/> <sprite n="caixa.png" x="128" y="774" w="32" h="32"/> <sprite n="cap.png" x="304" y="255" w="96" h="96"/> <sprite n="chaofalso.png" x="130" y="740" w="32" h="32"/> <sprite n="chaovoador.png" x="296" y="428" w="96" h="32"/> <sprite n="chefaoandando1.png" x="100" y="381" w="96" h="73" r="y"/> <sprite n="chefaoandando2.png" x="2" y="381" w="96" h="73" r="y"/> <sprite n="chefaoandando3.png" x="394" y="405" w="96" h="73" r="y"/> <sprite n="chefaoandando4.png" x="296" y="353" w="96" h="73" r="y"/> <sprite n="chefaoandando5.png" x="198" y="381" w="96" h="72" r="y"/> <sprite n="chefaocuspindo.png" x="198" y="306" w="96" h="73" r="y"/> <sprite n="chefaoidle1.png" x="100" y="306" w="96" h="73" r="y"/> <sprite n="chefaoidle2.png" x="2" y="306" w="96" h="73" r="y"/> <sprite n="chefaoidle3.png" x="402" y="330" w="96" h="73" r="y"/> <sprite n="coracao1.png" x="136" y="634" w="40" h="40"/> <sprite n="coracao2.png" x="139" y="592" w="40" h="40"/> <sprite n="coracao3.png" x="460" y="726" w="40" h="40"/> <sprite n="coracao4.png" x="460" y="684" w="40" h="40"/> <sprite n="corlava.png" x="304" y="165" w="192" h="32" r="y"/> <sprite n="cuspe1.png" x="483" y="209" w="8" h="8"/> <sprite n="cuspe2.png" x="483" y="199" w="8" h="8"/> <sprite n="cuspe3.png" x="503" y="130" w="7" h="8" r="y"/> <sprite n="espinhos.png" x="486" y="96" w="16" h="32" oX="0" oY="16" oW="32" oH="32" r="y"/> <sprite n="espinhoteto.png" x="486" y="42" w="22" h="32" oX="5" oY="0" oW="32" oH="32"/> <sprite n="explosao1.png" x="461" y="642" w="40" h="40"/> <sprite n="explosao10.png" x="394" y="480" w="68" h="64" r="y"/> <sprite n="explosao11.png" x="394" y="676" w="64" h="64"/> <sprite n="explosao12.png" x="260" y="599" w="65" h="63" r="y"/> <sprite n="explosao13.png" x="394" y="609" w="65" h="65"/> <sprite n="explosao14.png" x="2" y="649" w="64" h="63" r="y"/> <sprite n="explosao15.png" x="264" y="532" w="65" h="65"/> <sprite n="explosao16.png" x="195" y="525" w="67" h="64" r="y"/> <sprite n="explosao17.png" x="2" y="516" w="67" h="65" r="y"/> <sprite n="explosao18.png" x="2" y="583" w="66" h="64" r="y"/> <sprite n="explosao19.png" x="66" y="765" w="60" h="59" r="y"/> <sprite n="explosao2.png" x="142" y="542" w="49" h="48"/> <sprite n="explosao20.png" x="394" y="546" w="68" h="61"/> <sprite n="explosao21.png" x="2" y="788" w="58" h="58"/> <sprite n="explosao22.png" x="338" y="516" w="54" h="52"/> <sprite n="explosao23.png" x="464" y="480" w="46" h="47"/> <sprite n="explosao24.png" x="454" y="199" w="27" h="29"/> <sprite n="explosao3.png" x="338" y="462" w="54" h="52"/> <sprite n="explosao4.png" x="173" y="729" w="61" h="56"/> <sprite n="explosao5.png" x="327" y="631" w="65" h="60"/> <sprite n="explosao6.png" x="331" y="570" w="61" h="59"/> <sprite n="explosao7.png" x="193" y="591" w="65" h="63" r="y"/> <sprite n="explosao8.png" x="70" y="626" w="64" h="63"/> <sprite n="explosao9.png" x="71" y="559" w="66" h="65" r="y"/> <sprite n="latinha1.png" x="486" y="2" w="24" h="18" r="y"/> <sprite n="latinha2.png" x="486" y="22" w="23" h="18" r="y"/> <sprite n="latinha3.png" x="486" y="76" w="22" h="18" r="y"/> <sprite n="lava1.png" x="422" y="199" w="14" h="31" oX="0" oY="4" oW="31" oH="18" r="y"/> <sprite n="lava2.png" x="500" y="330" w="9" h="32" oX="0" oY="8" oW="32" oH="17" r="y"/> <sprite n="lava3.png" x="498" y="164" w="12" h="32" oX="0" oY="4" oW="32" oH="16" r="y"/> <sprite n="lava4.png" x="486" y="130" w="15" h="32" r="y"/> <sprite n="lava5.png" x="304" y="132" w="15" h="31" r="y"/> <sprite n="moeda1.png" x="268" y="462" w="68" h="68"/> <sprite n="moeda2.png" x="72" y="456" w="68" h="57" r="y"/> <sprite n="moeda3.png" x="72" y="515" w="68" h="42" r="y"/> <sprite n="moeda4.png" x="492" y="405" w="14" h="68"/> <sprite n="moeda5.png" x="464" y="572" w="43" h="68"/> <sprite n="moeda6.png" x="2" y="456" w="68" h="58" r="y"/> <sprite n="moeda7.png" x="198" y="455" w="68" h="68"/> <sprite n="pixel.png" x="504" y="101" w="3" h="3"/> <sprite n="pixelvermelho.png" x="504" y="96" w="3" h="3"/> <sprite n="sacola1.png" x="142" y="499" w="51" h="41" r="y"/> <sprite n="sacola2.png" x="142" y="456" w="51" h="41" r="y"/> <sprite n="sacola3.png" x="464" y="529" w="46" h="41" r="y"/></TextureAtlas>
-
Hello, I am trying to draw a design for coins that the player collects like in super mario game. The coins design might have some fixed number like 8 designs. I want to draw these based on some random number generation and picking up one design . I am using a paralaxer background and moving the coins. After the coins have gone behind the screen I want to draw a new design. I don't know how to do this as I am new to game programming, my friend suggested me a possible way might be to include an xml file ,which contains like 0 ,1's you draw where there are 1's and leave where there are 0's . I am using cocos2d-html5 for programming. I don't think it is a better idea to use text files to achieve this ,Is it ? If you have any better idea ,please tell me. Any code samples or weblinks(only in javascript) are greatly appreciated. I am posting a sample design ,how I want it to be., like this I am going to have several designs.