I wanna port my game prototype to Godot 4.3

When shooting zombies I paint a bunch of blood, keep the zombies around. When I shoot a bullet they stick on the floor. This in done in Phaser using a render texture. so basically whenever the bullet stops moving, I paint it (with all it's properties) to the render texture and it will stay there forever. So I can basically paint the floor. No extra cost, since I deleted the original bullet object.

prototype in Phaser (js): http://redroostermobile.com/topdown/

How can I achieve sth. like this in Godot?
Preferably performant and with the same coordinate system and sprite/texture properties.

So far I tried the franz fury approach (painting):

But I'm very confused with the coordinate system and scaling.

Current Setup:

  • A SubViewport with transparent background
  • containing a node2D
  • containing a Camera2D

This viewport will then be rendered by a sprite2D in my actual game node2d

I managed to draw a newly instantiated bullet on the subviewport-node by adding it as a child it's node2d, and removing it shortly after (viewport never clears)

Am I still on the right track here, or is this completely wrong these days?
Are there any examples of sth like that?

Sad state of affairs🙁the yellowish thing is the bullet and I painted it to the subviewport)

  • xyz replied to this.

    mojomajor Godot's viewports are equivalent to rendering into a texture.
    So yeah the accumulated drawing into a texture/viewport can be done as described in that video. For this to work you need a viewport that's the size of your whole map, or multiple viewports that tile over the whole map. Then you can just assign viewport's texture to a sprite that covers the entire map.

    You also don't really need a camera there.

      xyz

      Thanks for the reply and the reassurance. After removing the camera my coordinates are correct! Progress!

      Getting there