# Felix

Members

6

• Rank
Newbie

• Gender
Not Telling
1. ## Got problems with random movement

(I'm not the original poster. I just tried to help myself.)
2. ## Got problems with random movement

I can't get your example code to work at all and I'm to lazy to code it all myself. game.time.events.loop(3500, function() { this.game.add.tween(cell).to({x: this.game.world.randomX, y: this.game.world.randomY}, 19000, Phaser.Easing.Linear.InOut, true); }, this);I'm not a Phaser expert. Is it correct that this moves everything, every 3.5 seconds? Do you maybe want to use cell2 instead of cell? (Better call "cell2" -> "newCell" and "cell" -> "cellGroup" or "cells" to avoid confusion.)You probably also don't want to add the same event loop and set physics to arcade 20 times in a
3. ## How do I implement Hexagonal Tilemaps

I had this idea: I only use half of the "grid" for hexagon-tiles. Like this: -H-H-H-H-H-H-H-H-H-H-H-H-H-H-H-H-H-HGoing North would mean (x+0, y-2), North-East (x+1, y-1), South-East (x+1, y-1), South (x+0, y+2), South-West (x-1, y+1), North-West (x-1, y-1). I could store enemies in the empty tiles. Or I could declare them as above the other tiles. One tile would be drawn with some "overhang", so it overlaps with the empty tiles, like this: ....................... .......===========............................ ....../...........\........................... ...../.............\.
4. ## How do I implement Hexagonal Tilemaps

Thanks, but this isn't exactly what I was looking for. This is a tutorial about the math involved in hexagon. I would like to know the most efficient way to render hexagonal tilemaps and how to reuse code from the libraries. The tutorial uses a group of sprites with var hexagon = game.add.sprite(hexagonX,hexagonY,"hexagon");hexagonGroup.add(hexagon);Would everybody here recommend this approach? Then I would, for example, have to write my own loading and saving code. Can I use a Tilemap somehow?
5. ## learning to write a Javascript chess game

You might want to look into the "min-max" algorithm and it's more complicated optimization "alpha-beta" algorithm. Chess is a so called "zero-sum game". Other examples would be the nim-game, tic-tac-toe, and 4-in-a-row. What these games have in common is, that two players move after each other and that a situation that is good for one player, is bad for the other player. In those kind of games you can use the min-max algorithm. So google for something like "4-in-a-row min-max tutorial". I found this, but I didn't watch the videos: https://www.youtube.com/results?search_query=chess+min+max
6. ## How do I implement Hexagonal Tilemaps

Hi, I want to make my first Phaser game, a graphical Roguelike on a hexagonal grid. I know, a square grid would be easier, but let me try it anyway. How can I reuse as much code possible from the Phaser libraries (e.g. Tilemap) as possible? I would like, for example, to use the functionality of these examples: Depth Sort example http://examples.phaser.io/_site/view_full.html?d=groups&f=depth+sort.js&t=depth%20sort Tilemap Ray Cast http://examples.phaser.io/_site/view_full.html?d=tilemaps&f=tilemap+ray+cast.js&t=tilemap%20ray%20cast CSV Map (scrolling) http://examples.phaser
×