Author Topic: Recent Flashpunk convert -- trying to transfer my knowledge  (Read 1324 times)

jacobalbano

  • New Member
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Hey there :)

I'm transitioning to Flixel after a few years' experience in Flashpunk. So far I like the framework a lot, but there are some things that I feel are missing, or maybe I'm just looking in the wrong place.

* In Flashpunk, I'm used to designing my game objects as autonomous entities that are loaded from map files and never interact explicitly. The Flixel examples seem to all involve a FlxState that includes a lot of logic and hard references to objects. Is it possible to handle collision and interactions between objects from within each object?

* Flashpunk has a bunch of helper functions for collision like moveBy() and moveTowards(), which, when given a delta or destination, will move an object as far as it can go towards its target before it collides and stops just short of the collision. Are there similar features in Flixel? I haven't been able to find them.

* In Flashpunk I can override the moveCollide() function and decide which objects are collidable based on their type; for example, I can have it so that pawns of the same color can move through each other, but different colors trigger a collision. Can I do this in Flixel as well, or is it just a matter of manually grouping objects and running the collisions manually?

I've been able to intuit a lot so far, but I think my main problem here is that Flixel's approach to a lot of things is fundamentally different than Flashpunk's. I'd appreciate any help you folks are able to give to get me on the right track.
« Last Edit: Tue, Oct 8, 2013 by jacobalbano »

paala

  • Contributor
  • ****
  • Posts: 250
  • Karma: +0/-1
    • View Profile
Hello,
1. yes. for all objects you can override update then if istouching(left/right/up/down)
2. you can do this on your own very easy. if object .x <objecttobefoloowed .x {object.velocity.x =30} else obejct.velocity.y=0
3. yes in playstate, you can do that
Better for learn how thing are done is to study a tutorial like:
http://chipacabra.blogspot.ro/
I think there is a 2.5 version of this tutorial.