All Questions

Community

Ajinkya steelx

class extends

What is the difference in both :

In previous class , we used extends keyword before declaring class_name

extends Node2D
class_name Battler


But in ActiveTurnQueue, we did extends after declaring class_name

class_name ActiveTurnQueue
extends Node
  • Nathan Lovato replied

    There's no difference. The GDScript compiler does the same thing regardless of these two lines' order.

    We +/- recently added a guideline to the official style guide to put the class name first, to match most programming languages.