FAQ: Learn Phaser: Basics - Create A Config

This community-built FAQ covers the “Create A Config” exercise from the lesson “Learn Phaser: Basics”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Learn Phaser

FAQs on the exercise Create A Config

There are currently no frequently asked questions associated with this exercise – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this exercise. Ask or answer a question by clicking reply (reply) below.

If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this exercise, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head here.

Looking for motivation to keep learning? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!

const config = {width: 700, height: 700, backgroundColor: 2F0};
// why "is config defined" is getting thrown?
2 Likes

idk
solution was marked as
const config = {
width: 400,
height: 500,
backgroundColor: 0xffff77
}

const game = new Phaser.Game(config)

The documentation of Phaser 3 is mediocre at best, and the link from this lesson is a great example of it. In fact, the documentation doesn’t mention any of the 4 properties of config mentioned in the lesson. I feel like linking to the docs might actually discourage people from using this great engine, it is so unhelpful.

same error here. can’t get to next stage even though my syntax is correct.
“Is config defined”

I copied the solution and it passed

I’m a little confused about this part of the lesson. In the introduction it talks about calling “new Phaser.Game” and then it goes on a bit more about the concept but then it asks us to declare a config object and then to make a new game. It doesn’t tell us how to do that until you press the hint and then it shows “const game” in the first part of the hint I don’t understand what that means because it wasn’t introduced to me at all in this whole lesson and I feel like I missed something. I don’t like to use the hints or solution to pass but I don’t think it gave me enough information to find the answer myself and in the end I do not understand what “const” means and why they used that to create the config and game.

okay, so basically, i did the first thing, i did the whole const config = {
width: 400,
height: 500,
backgroundColor: 0xffff77
} and all that jazz, but how do i do the next thing, how do i fill out const game = new phaser.game(config);
it also tells me to save the results into a variable called game, how do i do that