• Content Count

  • Joined

  • Last visited

About BenClarkson

  • Rank

Contact Methods

  • Website URL
  • Twitter

Profile Information

  • Gender
  • Location
  • Interests
    Art, Coffee, Computers

Recent Profile Visitors

679 profile views
  1. Hi! I am working on a game with kids from the inner city in one of the most dangerous neighborhoods in Canada. I am trying to integrate multiple layers from tiles to control behavior of different sprite classes (like enemies) that have their own collision tiles separate from the player tiles. I cannot actually figure out how to make the physics system recognize any layer but the player's layer. I've been able to get around it before with some tile classes but now I feel I need the enemy to interact with the tilemap separately than the player. Below is some of my code. Please help! The children are waiting! map ='tiles'); map.addTilesetImage('tiletile') layer = map.createLayer('tiles'); this.enemyLayer = map.createLayer('enemyCollide'); this.enemyLayer.resizeWorld(); this.enemyLayer.debug = true; layer.resizeWorld(); map.setCollisionBetween(1,20); console.log(map.layers[2])
  2. I solved it! state.prototype.setOneWayTiles = function (map) {map.forEach(function(tile){if (tile.index == the tile index you're looking for) {set tile properties;} } )}
  3. Ok. I'm trying to build one way platforms using tilemaps and I don't quite know how to access all the tiles of a type (say, id '5' from the json) and give it custom properties (like tile.collideLeft = false). This would also be great for setting tile classes, like water, ladders, and other things. Cool! Thanks.
  4. Hey, I am hard at work on my game "Space Cat" and I have some questions about one way collision on tilemaps. Like, is there a way to do this without making the one way colliding tiles into immovable objects (which I assume isn't TERRIBLE, it still uses the quadtree but it has to update more variables). I have a collision tilemap in two layers, one with "ground" and "walls" and one for one way platforms. The problem is how the tilemap body is handled isn't super clear. I was thinking of writing an extension of the collide function to specifically deal with this. Any help would be groovy.
  5. There's also the issue of resizing AABB for the player sprite. I know it's possible but I have to use a constructor which hasn't been working for me. Can you help me out with the syntax?
  6. You're the best Rich. I have some questions. I bashed my head against my desk. I got my tileset to work. If I want different classes of tiles (one way platforms) I will have to place those on another layer with different properties correct? Right now to evaluate collisions with the tileset I am basically looping through all the tiles like in the tileset example and checking AABBVSTileset collisions. Will I have to do this independently for every layer? This seems very expensive. Is there a way to optimize that with groups? Ladders and spikes would also be on different layers? For these I would be doing an overlay check right? And for placing the art on top of the tileset I'd just put a sprite on the top of the draw group? Is there a more efficient way of managing large art maps like the kids will draw (ie breaking them up as a group?) Thanks a lot. I am really excited to show everyone what the kids end up making.
  7. Hi, I'm developing a quick framework to let at risk inner city youth design video game levels for a workshop I am leading next week. I have been playing around with phaser for about a month and I've got a decent handle of P2 and Arcade, but as I looked closer to what I'd need to be able to do to let the kids just draw levels on paper and then transfer that into a framework I've settled on Ninja because it allows for bounds, one way platforms and the overlay callback which lets them include some pretty standard platformer mechanics that I predict they'll want to include. So I am just having a little bit of trouble getting the slopemap to work with a tilemap. I am using the default ninja tilemap and then I am planning to import the art the kids draw overtop of the tiles so it looks like their characters are walking on the actual sprites. I am having a hell of a time actually getting this to work. Any help would be appreciated. The limited examples for Ninja physics is really draining. I really want to have a working prototype by the time I present the workshop. I'm going to be asking a lot of questions this week because I really want to present something fun for the kids to fuel their interest in computers (which are awesome) Cheers
  8. Cool, I had taken a look at that before and never put two and two together (the answer is four) Thanks a lot. I am probably going to switch to P2 physics when I start my next project.
  9. I think if you build in a kill for the objects crossing the world bound you should be fine to make sure you have some nice garbage collection. If you run into performance issues consider using inheritance to optimize what objects have what physics applied to them. Looking forward to seeing your game!
  10. Hi, I am new to phaser and I am programming a version of asteroids to get my sealegs. I wanted to take advantage of the bitmap data to create colorful gradient sprites for the ships lasers but I'm discovering the limits of arcade physics pretty quickly. I right now have a group of lasers which are bmd generated sprites. When the ship fires it grabs a random child and revives it, prints it, checks for bounds with the asteroid then is killed the next cycle. It looks great but with how the bounding box collision tests work — checking for collisions without physics — the laser collision test tells me true even when the laser clearly doesn't hit because of the ol' a^2 + b^2 = C^2. I eventually want to turn the asteroid's physics bounds into polygons too for less hilariously random player deaths. I've read a bit about SAT.js but I can't find documentation for the support in PHASER and I'm unclear about the limits of arcade physics. What would checking phaser lines, or angled sprites for collision with a polygon look like? Do I have to switch to PS to do line/ rectangle collision? Is this just a really silly way of doing this? Should I switch to an emitter (I might do that anyway for, like, really sweet machine gun effects). Thanks!
  11. You're going to build a sprite as bitmap data, looping through the different bands and save it to the cache and then apply some maths to it and make it into a sphere. You can do that the hard way (like finding an external library) or by just writing a stupid approximation — like looping through columns to make each pixel column a different height to create the illusion of a bulge? Then you'd save it as a sprite. I found some stuff that might give you an idea of the differences between the easy and hard way.