About 'Light2D Nodes'!

In this video (objectives)…

1 Set up a Light2D node 2 Set up Occlusion is autotiles and characters 2 Enable shadows

After watching (learning outcomes)…

How to bring dynamic lighting and shadows into a 2D game

(Unique Video Reference: 7_HM_GDT)

We would love to know…

  • What you found good about this lecture?
  • What we could do better?

Remember that you can reply to this topic, or create a new topic. The easiest way to create a new topic is to follow the link in Resources. That way the topic will…

  • Be in the correct forum (for the course).
  • Be in the right sub-forum (for the section)
  • Have the correct lecture tag.

Enjoy your stay in our thriving community!

For the flash light / torch toggle we are using the _input method that accepts an event argument. I think is better to use that event argument instead of also use the Input singleton as in my opinion it makes little sense to use the _input method if we are gonna continue using the singleton inside it’s body so I used:

func _input(event):
    if event.is_action_pressed('ui_flash_light'):
        toggle_flash_light()

I also defined a new ui action (ui_flash_light) for when key F is pressed

Privacy & Terms