0 votes

Hi, everyone! My friend and I are making a 2D block-breaker game. Once we've drawn the blocks, how do we make them change color on contact with the ball sprite?

We're starting out by doing the "Simple 2D Game" tutorial at the docs website

in Engine by (19 points)
edited by

1 Answer

+1 vote

The question is too generic, more details are needed, and these are 2 separate things but here are some ideas:

To do something on collision, depending on the game structure could be detecting collisions on the blocks or on the ball, or overlaps in the case of areas, during process or with signals, decide a way to work with your objects and use what you think is the best approach.

To change color of a sprite, can be via the modulate, using a shader for a special effect, having a hidden or transparent sprite on top to change it, making a spritesheet with all the modes and changing frames, etc.

by (7,806 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.