Search
 
SCRIPT & CODE EXAMPLE
 

GDSCRIPT

GDScript classes

extends Node2D

class_name Motorcycle

# Add properties
export(String) var make = "Kawasaki"
export(int) var cc = 900
export(Color, RGB) var color = ColorN("Ninja Green")
var fuel = 0.0
var speed = 0.0

# Override virtual methods
func _ready():
	add_fuel(17.3)

func _process(delta):
	if fuel > 0.0:
		speed += delta
		fuel -= delta
		print(speed, "km/h")

# Add a new method
func add_fuel(litres):
	fuel += litres
Comment

PREVIOUS NEXT
Code Example
Gdscript :: GAScript - Google Sheets - QBO API - Consent Dialogue Box 
Gdscript :: godot print enum name 
Clojure :: how to use clojure cond 
Clojure :: algorithm to reverse a string clojure 
Abap :: abap if statement 
Lisp :: emacs switch horizontal vertical 
Erlang :: erlang exit from shell 
Assembly :: jinja loop index 
Assembly :: include code in latex 
Assembly :: where correlation is used 
Assembly :: import svg in google slides 
Assembly :: how to check whether a row contains a numeric value or not in df 
Javascript :: jquery vslidation remove spaces from input 
Javascript :: window load jquery 
Javascript :: clean gradle react android 
Javascript :: toggle text jquery 
Javascript :: JavaScript that executes after page load 
Javascript :: javascript void(0) href 
Javascript :: jquery reload page 
Javascript :: java script converting text to slug 
Javascript :: change src of iframe jquery 
Javascript :: change input to required jquery 
Javascript :: return current date in javascript 
Javascript :: javascript random color generator 
Javascript :: sleep for 1 second 
Javascript :: fetch json post 
Javascript :: exclude node_modules from tree command 
Javascript :: mongoose nestjs installation 
Javascript :: generating component in angular without spec file 
Javascript :: number with commas js 
ADD CONTENT
Topic
Content
Source link
Name
1+3 =