i'm trying to learn godot, and i tried some tutorials, but they mostly have a step-by-step, copy-paste process, which doesn't allow me to understand how to use it in an original similar game.
i've decided i want to work on a project to understand better the engine, so i have an original endless runner game idea i'm trying to work on, one step at a time.

i'm trying to start with the most basic parts: character, moving background and foreground, and camera position.
my problem is i don't know what methods to use for these elements:

  • i want the camera to mostly be positioned with the character behind (left side of the screen) and occasionly be positioned with the character ahead (right side of the screen)
  • biomes will be changing along the run

i've encountered 2 methods:

  1. making a TextureRect into a shader and coding it to scroll visualy tutorial by Generalist Programmer on YT using godot 3.x
  2. making parallax background and coding the ground to reset position once outside of frame tutorial by Coding With Russ on YT using godot 4.x

both methods don't fit me, because i want changing backgrounds, and as a beginner i can't see how i can do it smoothly, and not in an instant, also i want the ground in one biome to be more interesting than a repeating, one-screen-sized, ground.
what i thought would be easier is make the ground appear off screen, then disappear when past the back part, off screen.

i'm trying to make it easy, but at the same time, made to be upgraded in the future to a full game.
it's even enough if you just give me direction or suggestion to what terms to look for. so, how do i do it?

    chameli What I do is go through a tutorial that is close to what I want, like the one you have bookmarked, and then start modifying it. If you have done it before, you don't need to do that. As you modify it, you will learn what you are doing. But just for organization purposes, etc. you have something to go on so it's not going to end up a bunch of spaghetti code.

      chameli Do you have a visual mockup or some existing game example of what you want to do?

        fire7side my problem is i can't find a tutorial that works in that way, and i sort of need to learn it from scratch to do it right. also i'm going for mobile (tho i'll obv use keyboard to run it on my pc), so i try managing the dinamic screen as well.

        xyz i'm going for rather simple gameplay, some similar examples would be the "Chrome Dino", "cobalt", "vaoult", "jetpack joyride". a 2D side scroller, with a jump button (single/double jump), a shooting button, running through a couple of backgrounds (for now the backgrounds are an astetic choice rather then gameplay changer) with straight, continuous, ground with obstacles.

        • xyz replied to this.

          chameli Have two texture rects the size of the screen (or wider) stacked one after another sideways. Slide them both from right to left. When the first one goes fully out of screen on the left, insert a new one on the right. Do this infinitely many times and you have an endless runner with ever changing backgrounds 🙂