GodotRoguelikeTutorial icon indicating copy to clipboard operation
GodotRoguelikeTutorial copied to clipboard

Chapter 03, some things are unclear

Open singalen opened this issue 4 years ago • 3 comments

  • Why should [0, 0] translate to to Vector2(100, 100), but START_X/START_Y have different values? Do they have a different meaning? What do they mean then, and why introduce but not use them?
  • It would be nice to add a comment to vector_to_array with a couple of examples, which coordinates should translate to which.
  • It's unclear why index_to_vector has 4 arguments, when only 2 are sufficient. What are the other two for?
  • Ditto about a comment.
  • What are sprite groups and what groups of objects require different groups?
  • Also, it would be nice to offer a way to duplicate the 2D scenes. Duplicating them in the MainScene editor doesn't let you edit them afterwards.

singalen avatar Aug 11 '20 05:08 singalen

Hi, I need some time to answer these questions. Probably by the end of this week. (8/16/2020)

Bozar avatar Aug 11 '20 09:08 Bozar

Thank you! No rush, I have got past them. It's rather a pointer to where the tutorial text may be improved.

singalen avatar Aug 11 '20 17:08 singalen

I have updated the tutorial and here are the short answers.

  • Why should [0, 0] translate to to Vector2(100, 100), but START_X/START_Y have different values? Do they have a different meaning? What do they mean then, and why introduce but not use them?
  • It's unclear why index_to_vector has 4 arguments, when only 2 are sufficient. What are the other two for?

Vector2(100, 100) is an example which has no special meanings. A sprite in the top left corner on the imaginary dungeon board is showed at Vector2(START_X, START_Y) on the screen. These two constants are used in vector_to_array() and index_to_vector().

If we want to show a sprite that is slightly away from the center of a dungeon board grid, we use x_offset and y_offset to move the sprite by pixels.

  • What are sprite groups and what groups of objects require different groups?

Group is a powerful tool in Godot. It acts like a tag that you can attach to a sprite.

  • Also, it would be nice to offer a way to duplicate the 2D scenes. Duplicating them in the MainScene editor doesn't let you edit them afterwards.

To duplicate a scene as another .tscn file, first select the original scene in FileSystem tab in Godot engine. Press Ctrl+D or right click the scene and select Duplicate... in the drop down menu. Give the new scene a different name and save it.

Bozar avatar Aug 14 '20 12:08 Bozar