Where to start with point and click game?

Hello!

I want to make a (in my mind) very basic point and click game but have no idea where to start. I have tried watching tutorials but haven’t found one that goes in the creative direction i want to go in. It is supposed to be a 2d game in which the player will stay on one screen the whole time. I want to have a few clickable objects that, when interacted with (interacted meaning clicked) will open a sort of pop up containing text. Does anyone have any tutorials that go in this direction or have tips on how to get started with this? I have only done one basic godot game so far and have no experience with this kind of mechanic (the clicking). I am sorry if this is a stupid question or worded unclearly, English is not my first language. Thank you in advance!!

2 Likes

I just googled point and click games godot

Got tons of links for YouTube and others. Have you tried looking at any of them?

3 Likes

Yep, but they all went in different creative directions than me/i wasn’t sure how to adapt them to my own project. In particular i am a little unsure on how i would go about making the “pop-ups” i mentioned, meaning clicking on an object would open a small screen filled with text, kinda like interacting with a npc and having dialogue except the npc is not a person in this case. But you’re right, i could probably get at least the clicking mechanic from one of the tutorials! Thank you :slight_smile:

2 Likes

There are also dialogue addons. Here is one. Watch the video

You will barely ever find a tutorial for every single thing exactly as you want it to be, this is why it’s not a good idea to rely on tutorials for very long. Use them to learn the basics of the engine and the language, then try to go off on your own.
If you have an idea, try to break it down into smaller parts, then try to figure out how to do those tiny tasks using the documentation or online sources.

Basically, try to become more independent, otherwise you won’t be able to build a game that works exactly as you want it to.

4 Likes

Yup tutorial hell for me, yk game dev is like lego pretty much, you can use instruction added to your package and make the build with it that you don’t expect or you can take bricks yourself and build something new and unique

both work but game dev is way harder than lego tho the rule is the same, you should try to learn how small components work and why, to use them for your own games, quick example

you have 3 bricks: IF statement, variables and 2D Sprite that represents red square
you want to enter number and if it’s bigger than 10 your square will be green, otherwise it will remain red

you can create number with variables:

var number = 7

you can check if it’s greater than 10 with IF statement

if number > 10:

and lastly you can change sprite color by referencing sprite

$"Sprite2D".modulate = Color(0, 1, 0) ##Green

when we combine these we’ll get:

var number = 7
if number > 10:
  $"Sprite2D".modulate = Color(0, 1, 0) ##Green

now let’s say you want to make it yellow if number is greater than 20, then you add another if statement:

var number = 7
if number > 10:
  $"Sprite2D".modulate = Color(0, 1, 0) ##Green

if number > 20:
  $"Sprite2D".modulate = Color(1, 1, 0) ##Yellow

i used the same bricks but achieved different results, this is game dev and that’s what you need to know

1 Like

No stupid question, and your English is totally fine. For a one screen point and click with text popups you really only need three pieces.

  1. Make each clickable object a TextureButton and put your object’s image in its Normal texture (add a Hover texture for a highlight). Buttons already handle clicking, so there’s no input code to write. For odd shapes, an Area2D with a CollisionPolygon2D and its input_event signal works too.
  2. Add one AcceptDialog node to your scene. It’s Godot’s built in popup with a text area and an OK button.
  3. Connect each button’s pressed signal (Node tab, then Signals) to a function that sets the text and opens the popup:
func show_text(text: String) -> void:
    $AcceptDialog.dialog_text = text
    $AcceptDialog.popup_centered()

func _on_lamp_pressed() -> void:
    show_text("An old oil lamp. It's still warm.")

Once that works, swap the AcceptDialog for your own PanelContainer with a Label to make it prettier. For real conversations with choices, the Dialogue Manager addon silocoder linked is the way to go.

I see what you mean.

Tutorials are great because they show you how to do something step by step. However, when you’re on your own creative endeavor, that’s just it. You’re on your own, but not fully!

So, what you’re looking to do involves mouse interactions, labels, sprites, and collisions. Break down what you want to do into smaller bits. No one will have an exact tutorial on how to make what you want. However, people do teach you how to handle collisions or how to have one node (the mouse) send a signal to another (the npc, which sends a signal to the label asking it to “pop-up”).

Look at the Godot docs, break down problems, ask the community once you’ve put decent effort into solving your own problems.

1 Like

Tutorials will help you understand the concepts and the tools at your disposal. However, creating the mechanics that you have in your mind will rarely have an exact tutorial so that part is up to you to come up with solutions always. Which is a fun process that game dev is all about.

So in order to solve every problem, you’ve got to split it into smaller parts that you can solve individually.

First problem is that you need to be able to detect when your mouse is hovering over an object. Conveniently, Godot’s Area2D/3D class already solved this issue with its mouse_entered and mouse_exited signals. So, for the clickable objects you wanna have in your game, add an Area2D node as a child. Now, you’ll be able to detect when mouse is hovering over your objects, horray!

The second problem is to trigger functions when the mouse is clicking on the object. For that, first create an Action named interact in the Project/Project Settings/InputMap and add mouse click as its event. Now, you can attach a script to the Area2D to do something when mouse is hovering over it and is clicked. Let me give you an example code.

class_name MouseDetector2D
extends Area2D


@export var pop_up_menu: Node2D
var mouse_is_hovering: bool = false


func _ready() -> void:
	mouse_entered.connect(_on_mouse_entered)
	mouse_exited.connect(_on_mouse_exited)


func _unhandled_input(event: InputEvent) -> void:
	if event.is_action_pressed("interact") and mouse_is_hovering:
		pop_up_menu.show()


func _on_mouse_entered() -> void:
	mouse_is_hovering = true
	
	
func _on_mouse_exited() -> void:
	mouse_is_hovering = false

Now, this should give you a good base to expand upon. I’ll leave the rest of the solutions up to you to figure out. Godot’s Documentation is your biggest friend.

The official docs are very good, I’d suggest reading the section about User Interface

1 Like