var manejador:FlxSprite = new FlxSprite(100, 100); manejador.makeGraphic(20, 20, 0); FlxSpriteUtil.drawCircle(manejador, -1 , -1, FlxColor.LIME); add(manejador);
Best posts made by galoyo
RE: [Solved] Game plays sound once and then cannot find file
i had a similar error with a sound file that embeds data. try removing all data from the sound file such as the year it was made or the name of the sound file in audacity. that should stop the sound crash.
EDIT: also, as I was programming, I documented all the strange happenings such as music crash or making tiled maps, bugs, etc. you might find useful this file https://github.com/galoyo/SpaceCastle/blob/master/dev/README FIRST.html
Most lag removed from the MPHX multiplayer library.
At github, mphx is a multiplayer library for haxeflixel. At that homepage the library is said to have lag issues. I removed most lag. The lag was created from the example file called movement . Now there is only a slight delay between moving the player and that same player moving at the other client. The library can be downloaded from my fork . Copy the downloaded mphx folder to the root of your project. The updated example file is here. At the example file, I also added onConnectionClose, disconnect event and function setExitHandler which will disconnect a player from other clients when that player closes the program.
The example file was tested with 4 open clients. Note that a fair amount of lag still exists with tcp. Udp is therefore the default. You can change back to tcp at mphx\client\impl\TcpClient.hx.
RE: Is checking for null values bad practice?
The code I use at
public static var state:PlayState;then at PlayState, I have
public var player:Player;then to check if that class exists, I use
if (Reg.state.player != null)at
The order in which a class exists is in reference to the map layer and its
Yvalues. If you have a
0, 0 coordinateand
2, 10, then the one at
0, 0will be called first.
about how to see the order, I don't know.
RE: Is checking for null values bad practice?
You could initialize the variable first but in some cases a null check is still needed. For example, the player class is called before a monster class but at the player class a monster var is used. A null is needed then. It is good practice to use a null check but if you are sure that the code is executed first then it is not needed.
RE: Space Castle - Open Source GPLv3 Platform Adventure Game.
This image shows some of the changes since this topic was created. Notice the mob that exits the tube or the mob that falls from the ceiling. I decided to make those features based on the Metroid game.
I am continuing to update the Space Castle Game.
Not currently in the game are falling spikes, two kinds of tiled slopes, flying hat, swimming skill, antigravity suit and more. When you place those items on the map and then build the game then they all work. They are just not yet in the current playable version of the game.
At the inventory screen, you can assign any item to one of the three action keys. For example, it is possible to reverse gravity with the "z" key and then when the player lands on the ceiling, you can do a antigravity jump with the "x" key, and in midair you can do a dash with the "c" key. everything just works.
Later, I would like to make a mini map system referring to the player's current location and bonus levels.
You can use the source code as your project or part of it within your game. Please read the GPLv3.
Edit: If you like the Space Castle then fork it because, who knows, the Space Castle repository at GitHub might be removed one day.
Here is another image that shows some features of the game. This image is the parallax car scene. The idea of that map is to travel to the Space Castle but that map might be used for something else. As the car moves forward, the user can increase or decrease its speed. Rocks fall straight down or at left and right angles.
Space Castle - Open Source GPLv3 Platform Adventure Game.
Hi everyone. This game called Space Castle is an open source retro style platform adventure game with a mystery storyline. The game has an ending and is similar in playability to the games Metroid and Cave Story. The game is released under the terms of the GNU GPL License. The Space Castle source can be downloaded at github.
Haxeflixel tutorials and more information about the game can be found at the wiki.
RE: [SOLVED] Problem with FlxG.overlap
try this code...
private function onDeskOverlap(player:Player, desk:FlxSprite):Void
private function onDeskOverlap(player:FlxSprite, desk:FlxSprite):Void
if desk is a tile then use
also, I use...
is it possible to play midi files? i found this lib, hxmidilib, which is a Haxe port of newgonzo's as3midilib for working with MIDI files. If it is possible to play midi with that lib. I need an example because using it is a bit confusing.
RE: AssetPaths not finding file
Sorry, I am still a bit confused... Then why when I put in the <assets path="assets" include="star.star" /> at project.xml that the files within the assets folder displayed in the popup content menu and without the "include" nothing displayed not even the menu? Remember that i was downgrading software and assetsPath stopped working.
IBwWG, i concluded that at the first link, the author was using a different path and was saying why the new path was not working. I may have misunderstood that message but I did get the idea of the "include" for the assets within the project file.