Point And Click Game. Like games by LucasArt.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Stub_in_de_house
  1. Question.
    How to do management. When a character increases and decreases, creating an illusion of depth. It In 2D

  2. Question.
    How to make areas of action. Buttons, doors, items, etc. And how to work with a lot of them on a scene.

:bust_in_silhouette: Reply From: kidscancode
  1. Adjust the character’s scale based on the y position. Quick example:
func _process(delta):
    scale = Vector2.ONE * range_lerp(position.y, 0, 600, 0.5, 1.0)

This would make the character shrink as it moves up the screen. Adjust values as needed.

  1. This is a rather large question. Here are some pointers to get you started:

Area2Ds with CollisionPolygon2D shapes. Drawing them out will/can be the tedious part. It really depends how you’re doing your level design. You can use groups and connect all their signals with a single script in the common parent:

func _ready():
    for area in get_tree().get_nodes_in_group("clickable_areas"):
        area.connect("input_event", self, "_on_area_clicked", [area])

func _on_area_clicked(event, area):
    if event is InputEventMouseButton and event.pressed:
        print("clicked on area", area.name)

You can also use mouse_entered and mouse_exited to make clickable areas glow/flash/etc. as needed.

Hopefully that helps you get started. The details will depend on your particular implementation.

Thank you very much. Everything is so simple … but I myself would not have thought of it =)

Stub_in_de_house | 2019-08-11 21:20