jopcode

Members
  • Content Count

    28
  • Joined

  • Last visited

About jopcode

  • Rank
    Member

Profile Information

  • Gender
    Male
  • Location
    Chile

Contact Methods

  • Skype
    krivair

Recent Profile Visitors

697 profile views
  1. Hello, I'm trying to scale the layers of my map, but when I try it shows part of the following tiles, some idea of how to solve this ?, the map is created in tiled, the spritesheet is 16 x 16: CODE create function: map = this.make.tilemap({'key':'01'}); const TilesPacked = map.addTilesetImage('tiles_packed', 'tiles_packed'); const SnowExpansion = map.addTilesetImage('snow-expansion', 'snow-expansion'); groundLayer = map.createDynamicLayer('Wall', [TilesPacked,SnowExpansion], 0, 0).setScale(2); const Ground = map.createStaticLayer('Ground', [TilesPacked,SnowExpansion], 0, 0).setScale(2); const OverGround = map.createDynamicLayer('OverGround', [TilesPacked,SnowExpansion], 0, 0).setScale(2); const Npc = map.createDynamicLayer('NPC', [TilesPacked,SnowExpansion], 0, 0).setScale(2); player = this.physics.add.sprite(16*3, 16*3, 'characters', 1).setBounce(0.2).setScale(2); preload function: this.load.image('tiles_packed', 'sprites/tiles_packed.png'); this.load.spritesheet('characters', 'sprites/characters.png', {frameWidth:16, framaeHeight:16}); this.load.image('snow-expansion', 'sprites/snow-expansion.png'); this.load.tilemapTiledJSON('01', 'sprites/Maps/02.json');
  2. Hi, i want make a rpg game but i don't know what frameworks use for it, i would can use phaser but i have difficulty with this( collide, physics, etc), any idea o suggest for make my rpg game? ( i don't want use unity)
  3. Hi guys i have a tilemap with 4 layers(ground, water, roads, others) and a sprite with my character. how i do would for my character can collide with everything inside on others(layer),every layer use a different sprite, example ground use ground.png, water water.png etc, i have this code ( i use https://github.com/lean/phaser-es6-webpack): /* globals __DEV__ */ import Phaser from 'phaser' import Mushroom from '../sprites/Mushroom' import Link from 'phaser-link' export default class extends Phaser.State { super() { } init () {} preload () { this.load.image('terrain', '../../assets/sprites/tileset_basic_terrain.png', 16, 16) this.load.image('this.others', '../../assets/sprites/tileset_other.png', 16, 16) this.load.image('water', '../../assets/sprites/tileset_water.png', 16, 16) this.load.tilemap('tilemap', '../../assets/map/overworld_01.json',null,Phaser.Tilemap.TILED_JSON) this.load.spritesheet('character', '../../assets/sprites/character.png', 16, 32, 1) } create () { this.map = this.game.add.tilemap('tilemap') this.map.addTilesetImage('tileset_basic_terrain', 'terrain', 16, 16) this.map.addTilesetImage('tileset_other', 'this.others', 16, 16) this.map.addTilesetImage('tileset_water', 'water', 16, 16) this.ground = this.map.createLayer('Ground') this.ground.resizeWorld() this.water = this.map.createLayer('Water') this.water.resizeWorld() this.others = this.map.createLayer('Others') this.others.resizeWorld() this.game.physics.arcade.enable(this.others) console.log(this.map.layers[3]) this.roads = this.map.createLayer('Roads') this.roads.resizeWorld() this.map.setCollisionBetween(0,1000, true, this.others) this.physics.startSystem( Phaser.Physics.ARCADE ) this.link = this.add.existing(new Link({ game: this.game, key: 'character', controls: true, })) this.game.camera.follow(this.link); } update() { this.game.physics.arcade.collide(this.link, this.others); } render () { if (__DEV__) { //this.debug.body(this.player,16, 32) } } } But sometime when i try test the collision between the player and layer others, this don't work correctly, collide in a blank block in somewhere place for example left and top place, but in bottom and right place the collide work correctly. for create my map i use tilemap editor 1.0.3 Images of example: there i can't move more to right: there i can't move more to bottom: there work correctly Sorry for my bad english. and thanks overworld_01.json
  4. someone can help me ?
  5. Hi!, i use tiled for create a map, but when i try show the map in the game, this doesn't show correctly (the map in tiled) And the map in the game: The main file: class Main extends Phaser.State { create() { this.game.physics.startSystem(Phaser.Physics.ARCADE); this.game.add.sprite(0, 0, 'Sky'); this.map = this.game.add.tilemap('Tilemap'); this.map.addTilesetImage('Tiles', 'Tileset'); this.layer = this.map.createLayer('Platforms'); this.layer.resizeWorld(); this.wrap = true; this.cursors = this.game.input.keyboard.createCursorKeys(); } update() { if (this.cursors.left.isDown) { this.game.camera.x -= 8; } else if (this.cursors.right.isDown) { this.game.camera.x += 8; } if (this.cursors.up.isDown) { this.game.camera.y -= 8; } else if (this.cursors.down.isDown) { this.game.camera.y += 8; } } } export default Main; Any idea or solution?(sorry for my bad english)
  6. I got it, first create an Object on Tiled for each Platform that contains the Width, Height, X and Y, and with these parameters I could complete my objective, I leave the code used in case is useful for someone (Sorry for my bad english) this.PlatformsLayer = this.map.objects.PlatformsLayer; for (var i = 0; i < this.PlatformsLayer.length; i++) { this.enemyGround.create(this.PlatformsLayer[i].x, this.PlatformsLayer[i].y - 32, 'tiles', 66); this.xMove = (this.PlatformsLayer[i].x + this.PlatformsLayer[i].width) - 32; this.game.add.tween(this.enemyGround.children[i]).to({ x: this.xMove }, 2000, Phaser.Easing.Linear.None, true, 0, 1000, true); }
  7. @ITpaolo this enemies already can move, but I want place this enemies over the platforms and only can moved inside the platforms
  8. @ITpaoloBut, my map has been already created, tileset, json etc has been created and placed, i want place a enemy over a platform already created, and this enemy only can moved(right to left, left to right) over this platform.
  9. Hi guys, i want to add an enemy over a platform and this enemy can move in the limit of the selected platform, i'm using tilemap created with tiled, but i do not have idea how do it, any idea?
  10. Hi guys, i am new in game design and looking for tips, tutorials, programs, etc, for this, any help is greatly appreciated
  11. @Tom Atom I solved it, using my code with only one variation in: if(this.upKey.downDuration(20)) changed it for : if(this.upKey.justDown) And the double jump work correctly, very thanks for you help <3
  12. @Tom Atom With Chrome, trying now decrease that
  13. @Tom Atom With this code happen to something similar that with my code, sometimes I'm can't to double jump, only can jump one time, any idea?