Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - sheep42

Pages: [1]
help / [Flixel-GDX] Pointer Issues [RESOLVED]
« on: Sat, Feb 27, 2016 »
Hi There,

I'm having some odd issues with the mouse pointer in my game and I'm hoping someone might be able to help me out.

When I have the game running in the default window things work perfectly, however when I resize or maximize the window the mouse pointer becomes offset. I am suspecting this might be something to do with LibGDX as it seems like the system pointer is also offset when I show it. When the button is hovered it will activate a hover state and turn the button white. I have temporarily shown the system pointer on top of the Flixel pointer for demonstration purposes.

Here's a screenshot of the window at it's starting size (working properly):

Here's a screenshot of the maximized window(offset issue):

As you can see in the attachments, when the window is maximized, the flixel pointer is drastically offset from the system pointer and neither pointer is triggering the hover state at the proper position. The same issue carries over mobile touch events. Any help would be greatly appreciated.


help / Flixel-GDX PreLoader
« on: Sun, Sep 20, 2015 »
Are there any examples anywhere of a FlxPreloader implementation in Flixel-GDX? Not sure if it's even possible, I've been searching for a bit and coming up empty-handed. If it's not possible, does anyone have any suggested methods for preloading with Flixel-GDX?


help / Flixel-GDX: Help with Box2D Collision
« on: Sat, Jan 10, 2015 »
Hi All,

I am working on my first original game prototype and I'm struggling a bit. Please feel free to tell me if I'm doing something stupid, I'm here to learn as much as I can and I've only got Google to guide me.

Background info: The game is a 2d, top-down game that involves moving around the screen and avoiding enemies. When I started the game I was using Flixel-GDX on its own and everything was going well, but then I decided that I wanted the enemies to have a field of vision that covers only a certain area in front of them which will trigger the logic that makes them follow the player. After looking into it a bit I thought it would be a good idea to create the field of vision as a polygon and test for a collision with the player. I figured out that I could not create polygons in Flixel, so I set up Box2D which allows for the creation of many types of shapes. After getting that set up, I converted all of my sprites to B2DFlxSprite and now I'm having issues and any help would be awesome.

My Issue:

When I use Flixel collision, I have to cast the B2DFlxSprite to a FlxObject and it's adding 11 pixels to the screen position. This is problematic because I have a sprite which is removed from the screen and later re-drawn and it gets offset by 11px.

When I use Box2d collision, nothing happens. I played with the collision examples a bit and read about how collision is handled in Box2d and I was able to get a working demo running with dragable objects. I think the issue might have something to do with the fact that I'm setting the velocity of my sprites with the FlxSprite functions, but I'm not sure.

Can anyone provide some insight on this? I feel like there's something important that I'm just not getting.


help / Help! Using Flixel-GDX + Flixel-GDX-Box2D
« on: Sun, Nov 30, 2014 »
Hey Folks,

I'm a new poster to the forum, but I've been using Flixel for a while and I made the switch to Wing Eraser's awesome Flixel-GDX port recently when I discovered it. I've been working on a game and I realized recently that I need to use box2d. I was hoping to get Box2d going using the box2d port located here:

Unfortunately, there is not a whole lot of documentation for that specific box2d port and I am a bit stuck. I've written a very simple test to render a box on the screen but I have not been able to get it running.

I've been getting this error message:
Code: [Select]
at org.flxbox2d.collision.shapes.B2FlxShape.draw(

I tracked the issue down to the line where the box is added to the world. But I can't figure out why it's failing. When I comment out add(box.create()); The application will build and run, but the box is (obviously) not created. This error occurs when adding any B2FlxShape objects but when I add a normal FlxSprite everything works as expected. Any ideas?

Here's the code that I've got written so far:
Code: [Select]
import org.flixel.FlxG;
import org.flixel.FlxSprite;
import org.flxbox2d.B2FlxB;
import org.flxbox2d.B2FlxState;
import org.flxbox2d.collision.shapes.B2FlxBox;

import com.badlogic.gdx.physics.box2d.Box2DDebugRenderer;
import com.badlogic.gdx.physics.box2d.World;

 * A parent class for testing.
 * @author Ka Wing Chin
public class PlayState extends B2FlxState{

private World world;

public void create(){
B2FlxB.setGravity(0, 9.81f);
FlxG.visualDebug = true;

B2FlxBox box = new B2FlxBox(50, 50, 50, 50);

public void update(){


public void destroy(){

Any help is much appreciated. Thanks!

Pages: [1]