Jump to content

Struggling with the basics


NibblyPig
 Share

Recommended Posts

So I started with phaser 3, but a lack of examples on the site made me switch to phaser 2. Phaser 2 I was struggling to get anything to work properly, so I have switched to pixi js instead as I don't want a physics engine or anything crazy.

All I want to do is render graphics to the screen. I will take care of everything else myself.

So I looked at the examples and I have what I would call a spritesheet, it has lots of different tiles on. All I wanted to do was load it so I could draw whatever tile I wanted at whatever co-ordinates.

The example on the pixi js is for animation. I don't want to do any animation (yet). Also every tile is 16x16 so I didn't really want to create a giant json file with thousands of lines. I tried to use some free tools to create the JSON file anyway because I couldn't figure out how else to do it, but none of them seemed to do what I wanted. TexturePacker didn't seem to, neither did Shoebox, although their documentation was lacking and the UI was incredibly unintuitive.

In Phaser 2 I found I could do this:  `this.load.spritesheet('walls', '/assets/TileSpritesheet.png', 16, 16);`

I feel like I am failing at even the most basic of operations so I wonder if I am missing something obvious, perhaps a really good tutorial video or something. I've programmed before in XNA and monogame and made a few 2d games, the only functionality I require is to be able to render sprites to the screen.

Can anyone suggest what I should do? I have a lot of tiles so splitting it into individual pngs would be very tedious.

Link to comment
Share on other sites

JSON format works fine. Both TexturePacker and Shoebox are good to make pixi spritesheets. Just follow our only good y tutorial for pix basicsi: https://github.com/kittykatattack/learningPixi 

As for tiles, when Sprites will be too slow for you, I recommend to look at https://github.com/pixijs/pixi-tilemap and https://github.com/Alan01252/pixi-tilemap-tutorial This plugin was developed for rpgmaker MV.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...