@immy Nice, this will be really helpful when it comes to debugging. I will check it out.
Posts made by RichardBray
-
RE: game crashes after pressing "play" button
-
RE: game crashes after pressing "play" button
That's odd. Do you have a coin.png file in your assets folder? Sometimes restarting VSCode tends to fix these sorts of random issues.
-
RE: game crashes after pressing "play" button
Hey @Immy I've just seen you've uploaded a .zip of your code to github which is helpful
https://github.com/ImmyShack/TurnBasedRPGl but not as helpful as uploading the code itself.
Here's an example of a game I have on github
https://github.com/RichardBray/Kevin-and-MaiseyAll the time a change is made to my game I update the code on GitHub as well. It's also easy to read the code on Github like this:
https://github1s.com/RichardBray/Kevin-and-Maisey/blob/master/source/levels/Intro.hx -
RE: game crashes after pressing "play" button
@immy said in game crashes after pressing "play" button:
I have a github account.
https://github.com/ImmyShackAh sweet. It would be great if you could upload the HaxeFlixel game you're working on. If you need help doing so I'll be happy to advise.
-
RE: game crashes after pressing "play" button
Going forward it would be ideal if you were able to upload your code to Github as it'll be easier for me to download and test your updated code.
Anyways, for your first error do you have this among your list of imports at the top of the MenuState.hx* file?
import flixel.group.FlxGroup.FlxTypedGroup;
For your second error. When I was debugging your code I found out the error message wasn't necessarily related to the file that the error is being flagged on.
You'll have to look through your code and make sure you don't have a nested function in a method that you are calling outside of the parent method. Like this:
class Test { function methodOne() { function functionOne() { ... } } function methodTwo() { functionOne(); // <-- This won't work } functionOne(); // <-- This won't work either }
-
RE: game crashes after pressing "play" button
Actually, I was looking at your "assets/data/room-001.json" and it looks like your numbers don't add up to what the demo has. Take a look at this section
And compare that with the data from the actual demo room-001.json file:
https://github.com/HaxeFlixel/flixel-demos/blob/master/Tutorials/TurnBasedRPG/assets/data/room-001.json -
RE: game crashes after pressing "play" button
Lol, that's interesting. I'm not an Ogmo expert but I'll take a look at it when I get some time.
Btw two things you should consider:1 - Getting a Github profile and uploading your project there. It would be easier for people to view the code and make comments on it.
2 - Signing up to Discord and joining the HaxeFLixel channel https://discord.gg/MsEBFF4D it's way more active than the forums and the creators of Ogmo are frequently on there.
-
RE: game crashes after pressing "play" button
Maybe we might need to pair on this, might be easier to debug this over a call, DM me if you're interested.
Anyway, the Player.hx file shouldn't have any collision data in it since the walls variable doesn't exist in the player. IMO you should delete lines 88 to 92.
TBH I'm not sure what the tutorial says but if you think you'll need the update method in player maybe try commenting it out for now.
-
RE: game crashes after pressing "play" button
Thanks for sharing this with me. I've managed to get it working and there are a few things I had to fix. I will lay them out below:
- in Player.hx
public function new(x:Float = 0, y:Float = 0) { super(x, y); <--- move super method call up here loadGraphic(AssetPaths.player__png, true, 16, 16); setFacingFlip(FlxObject.LEFT, false, false); setFacingFlip(FlxObject.RIGHT, true, false); setSize(8, 8); ...
override function update(elapsed:Float) <-- remove the whole update method { FlxG.collide(this, walls); super.update(elapsed); }
Usually, the super method is one of the first things to get called in a class constructor (new) or create() method
- in PlayState.hx
class PlayState extends FlxState { var player:Player; var map:FlxOgmo3Loader; var walls:FlxTilemap; var map:PlaceEntities; <-- remove this line
override public function create() { ... } function placeEntities(entity:EntityData) <--- move outside of the create method { ... }
override public function update(elapsed:Float) { super.update(elapsed); FlxG.collide(player, walls); <--- add this line here }
Aaaaand I think that's everything 🤞
Let me know if you're still having issues.For future reference. If you right-click on your game running in Chrome, choose "Inspect Element" and look at the console tab, it usually gives more information about an error you may be having.
As you can see from the image above I spotted the issue was one line 15 of Player.hx
-
RE: game crashes after pressing "play" button
Good question. If you're familiar with GitHub (or similar sites) you could upload you r code there. If not you could give me a link to the .zip file from something like Dropbox. I'm not sure if you can upload zips to the forum.
-
RE: game crashes after pressing "play" button
Yeah, that's weird. Are you comfortable sharing your code files? I wanna try it out on my machine. Maybe there's something I'm not seeing 🤔
-
RE: invalid field access : volume
To get freeplay to work, you need to replace the contents of NGio.hx with this:
https://gist.githubusercontent.com/jbmagination/caf9eb6a7ae8b415e8acd02962f851e1/raw/d76486854a7676a0ce16907dfa82bf804b155388/NGio.hx -
RE: game crashes after pressing "play" button
Could you try putting the
super.create();
from line 18 above line 15.If that doesn't work would you be able to share the error output from the Chrome developer console so we can better diagnose the issue?
-
RE: Is there any prebuilt classes that will aid me in making a text input field?
Hey @Adventure4Life wow I'm surprised your question hasn't been answered sooner. Not sure if you've found a fix to your problem yet.
This is not something I have personally done before but I think flixel-ui is something you should look into https://github.com/HaxeFlixel/flixel-ui
Also, there seems to be somewhat of an example here, but it seems quite buggy :( https://haxeflixel.com/demos/Calculator/
-
RE: I can't compile a template!
Hey @EmeraldWizardX sorry you're experiencing this issue. I'm assuming you're attempting a HTML5 build. Possibly the port 8080 is already in use.
Would it be possible to see the exact error you're getting from the terminal?
-
RE: Empty tilemap
@alucca I have a feeling that mapquest driving game wasn't built with HaxeFlixel 🤔
-
RE: Hi, im a junior where i can start to create games?
@alucca was impostor built with HaxeFlixel?
-
RE: Why does my anti-virus say Haxeflixel is a threat?
Hey @Nickccnt that's interesting, you're the second person to have this issue. I have a feeling maybe HaxeFlixel is an unpopular open-source game engine and therefore isn't recognised by the Windows antivirus software.
Would it be possible to share a screenshot of the virus warning and let us know where you're downloading FNF from? Also, what anti-virus software are you using?
-
RE: PLAYSTATE IS GONE I AM A BEGINNER HELP
Hey @DrawzSoup always happy to see new people join the community 💪
tbh I'm not quite sure what your question is. But in regards to the lime warning, try downgrading to 7.8.0. That should fix it.