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.

Messages - Minverva

Pages: [1] 2 3 ... 7
help / Re: FlxTilemap and FlxTile
« on: Wed, Jun 17, 2015 »
Hello again!

I am messing around with FlxTilemap and I cannot figure out how to return a specific tile from a coordinate position. I can get the type with getTile(), but I am unable to actually access the tile. I need this because I am making a game where you are able to dig, which leads me to my next question.

Is there any way to add variables to a tile? For instance, in this case I want the tile to have some sort of life so when the player is holding down the mouse, it removes from the life and when the life is gone the tile is destroyed. I know I can do this by editing FlxTile, but I am hoping to find a way to do it without having to edit it. Thanks!

I don't believe FlxTileMap actually has specific tiles you can manipulate like that. I could be wrong though; I haven't worked with it much.

I'm also having this problem. When I scroll the camera, it seems as if the rect used to check for mouseover is left in the original position.
Anyone have the answer to this question?

I haven't run into this - have you trying updating the button?

help / Re: Moving platform collide
« on: Mon, Jun 15, 2015 »
The problem is that when the player jumps on the moving platform it floats away. Also when I jump against it from underneath it flys away ;).

I searched for "fixed" but I couldn't find it. Is it really in Flixel version 2.55?

My apologies for being unclear. "Fixed" is in an earlier version that I'm using.

As for your problem, you could try overriding the collide function or switch to using overlap. You can set the behavior specific for each "Contact" (e.g. if(Contact is Player)...) when you override the collide functions.

help / Re: Moving platform collide
« on: Sun, Jun 14, 2015 »
You are using a slightly different version from me. My version uses "fixed" which does prevent collisions under some circumstances (usually with other fixed objects).

I'm not entirely sure if I understand your problem, but try setting your drag.x and drag.y variables to high levels.

help / Re: Moving platform collide
« on: Wed, Jun 10, 2015 »
It is slowing down because it is running the default collision function.

There are many ways you could fix it. One option would be to simply use a very high acceleration and lowish maxVelocity instead of changing velocity directly. I noticed a bug in my version where altering velocity directly can mess up collision detection. I haven't fixed it yet, but I think it might be best to stick with acceleration.

help / Re: FlxGroup x and y?
« on: Fri, May 29, 2015 »
I'm trying to read my objects inside a FlxGroup using the forEach function:

Code: [Select]

and the checkAttackRange function is:

Code: [Select]

private function checkAttackRange(hut:FlxBasic):Void {


The thing is, inside my checkAttackRange function there is no option for x or y. So if I do hut.x, it does not recognize the x in hut. How can I fix this? Thanks

Try doing:

Code: [Select]

private function checkAttackRange(element:*, index:int, arr:Array):Void
  //you should be able to use element.x or element.y here

help / Re: FlxWeapon shooting with offset
« on: Sun, May 10, 2015 »
Ok, I'm not seeing how you are firing it with your code and like I said I haven't used powertools. Maybe try using the "fireatposition" function instead? You could then set the X/Y equal to the mouse coordinates, but with whatever offsets you want.

Maybe it would look something like:

lazer.currentBullet.fireAtPosition(_player.x+_player.width/2, _player.y+_player.height/2, FlxG.mouse.cursor.x+10, FlxG.mouse.cursor.y+10, 200);

help / Re: FlxWeapon shooting with offset
« on: Sun, May 10, 2015 »
Would you mind posting the FlxWeapon code? I don't use power tools.

Well, it does collide with objects, but there seems to be situations where it doesn't. If I have the platforms move flush against a FlxTileBlock, the player on the platform won't collide with the tileblock and will instead overlap it slightly (hurts the player). I basically designed levels to avoid that situation.

I think this might be related to the platforms slowing down before stopping which messes up the collision boxes. None of these problems occur when the player is moving while on the platform.

I haven't worked with Flash/Flixel in some time, but I seem to remember that Flixel's collision only handles one collision at a time.  I wonder if you'd be able to get around this by having a separate collider on the player that ignores collision with the moving platform, but not with static parts of the level.  Or if you need the second collider to also detect moving platforms, make the collider a bit shorter and raised up a bit so that it doesn't touch the platform you're riding.  Does that make any sense?

Well, since then I've designed my levels in a way that this bug doesn't matter. It is still very strange though. It seems like the bug might be based on the platforms changing their velocities which messes up the collision detection, because collisions I thought wouldn't get detected are working when the platforms aren't going back and forth and when they aren't near their end points (they slow down before stopping).

The "single collision" explanation is interesting. I've noticed that flixel has trouble with collisions when the velocities are high. Another easy way to mess up collisions, which I've used intentionally, is to call the update function of an object multiple times.

Sorry if I'm being a bit TL;DR so far. I'm not sure what you mean by adding a separate collider, but if there is some way to improve collision detection for the player then I'm certainly all ears.

help / Re: Change FlxGroup Member properties
« on: Mon, Apr 20, 2015 »
I'm not sure. I haven't used setAll (not in the version of Flixel I've been using I think). With forEach you can run a function for all the members of your FlxGroup which gives you an enormous amount of flexibility since you can put conditionals in it.

The basic form of that function could be something like:

Code: [Select]
private function EnemiesFallBack(element:*, index:int, arr:Array):void
   if(!element.disabled) //public boolean "disabled" for enemies to indicate if player has whammied them
         if(_player.x > element.x) element.velocity.x = -100;
         else element.velocity.x = 100;

         if(_player.y > element.y) element.velocity.y = -100;
         else element.velocity.y = 100;   

A function like that would tell all your enemies to retreat from the player, but their motion would be based on their relative position to the player - and they'd only do it if they weren't disabled by the player.

help / Re: Change FlxGroup Member properties
« on: Mon, Apr 20, 2015 »
Yes, you can do something like this in the playstate:


Another method would be to use static variables to communicate between the sprites, but that's a bit more complicated I think.

help / Re: Dynamic FlxTilemap Tile Colorization
« on: Sun, Apr 19, 2015 »
I think FlxTileBlocks might use less resources. I've been manually creating levels with them for the past few weeks. Some of the fun things you can do with them are do give them velocity, drag and make their solid property equal to false (fake walls). Invisible walls are easy to do by setting visible to false, but I prefer making them difficult to see by using a different tileset.

I suspect you can probably do some similar things with FlxTileMaps - and using multiple flxtilemaps with different properties on the same level is probably fine (i.e. have one FlxTileMap of objects moving onto or off the world bounds).

Honestly, I think I'd be using FlxTileMaps now if I'd noticed them. I'm using FlxTileBlocks mainly because that's what Mode used and I think Adam probably used them because of either the resource issue or he found it easier to randomly generate levels with them.

help / Re: Dynamic FlxTilemap Tile Colorization
« on: Sat, Apr 18, 2015 »

On a side note, I never really looked at FlxTileMap before. I was messing around with it and it is really neat. The only problem is that my game is built around using FlxTileBlocks and so all the AI and other logic based on colliding with FlxTileBlocks doesn't work with FlxTileMaps.

It would be extremely tedious to change it to affect FlxTileMaps and I'd be asking for a lot of bugs in the process. Do you know any way for FlxTileMap to add FlxTileBlocks instead? That would be really useful.

help / Re: Spell check?
« on: Sun, Apr 12, 2015 »
I agree, this is reasonable as a plugin for an IDE, but not implemented into a compiler - two entirely different things.

I'd never heard of the term IDE before; I didn't realize FlashDevelop was an IDE. I'd been referring to it as a compiler.

Learn something new every day.


help / Re: Spell check?
« on: Thu, Apr 9, 2015 »
You could say the same things about a word processor. The point is that it would be a feature that would save time and reduce errors. There are a lot of features in Gimp that I don't use, but I don't begrudge them to people that do use them.

As for which strings should be spell checked, I believe I mentioned that earlier - spell check words between quotation marks. That should take care of the vast majority of situations I think.

Here is a similar tool for Visual Studio:

It has been downloaded 220k times and is highly reviewed. There is clearly a desire for such a tool among some people.

help / Re: Spell check?
« on: Mon, Apr 6, 2015 »
Sure, I've done that sort of thing in the past. Right now I'm designing levels and so I'm passing brief strings to computer terminal objects for the player to read. I also have strings in the briefing/debriefing screens that should be spell-checked too. I'm usually just so focused on placing the computer objects correctly and building the level that I don't open another program and spell check them.

It seems like it would be really convenient for the compiler to parse the strings out of the code and then spell check them. I'm just surprised nobody has done this.

help / Spell check?
« on: Sun, Apr 5, 2015 »
Anyone know of a good tool that can spell check anything between quotation marks in your code?

Hopefully something integrated into Flash Develop would be nice.

This seems like a fairly obvious feature, but I can't seem to find it.

This seems to be related to colVector.x in some fashion.

I tried setting the player's colVector.x equal to the platforms, which makes the collisions work against some stationary objects (but not others strangely), but the collisions with mobile fixed objects are still sketchy at best.

It seems like colVector.x might be getting recalculated elsewhere which is preventing collisions.

Unfortunately, this screws up collisions with other mobile non-fixed objects while standing on the platform.

It is an odd question, but here is the situation.

Essentially, I created platforms that the player can use to ride between two points. The player and other objects collide with these platforms normally, but if the player stands still while on a moving platform then he doesn't seem to collide with other platforms or fixed objects.

The game thinks the player's velocity is 0 even though he is being moved by the platform. I need the game to think he is moving so it will check for collisions, but without actually moving him because it would mess up the ride on the platform.

Pages: [1] 2 3 ... 7