Godot 3.0 - GDScript Introduction
Godot Download: https://godotengine.org/download
Godot API: http://docs.godotengine.org/en/stable/classes/index.html
Note: This video is intended for people who already know how to program in at least one language, and is meant to introduce the concepts that differentiate GDScript from other languages.
GDScript is the language used for makings scripts in the Godot engine. The other build of the engine however uses C# if you're already familiar with that language. This video will introduce you to the basic structure and some of the more commonly used methods.
Code:
extends Node2D
signal landed
export var msg = "hi" #9.0
const GRAVITY = 200
onready var hp = 0
onready var spd = 200
onready var input
onready var mov = [Vector2(-spd, 0), Vector2(spd, 0)]
onready var grounded = false
func _ready():
print(msg)
define_input()
set_process(true)
pass
func _process(delta):
for x in range(2): #0: up
if(Input.is_action_pressed(input[x])):
position += mov[x] * delta#position = position + move[x]
elif(false):
pass
else:
pass
if(!grounded):
position.y += GRAVITY * delta
func define_input():
input = ["ui_left", "ui_right"]
func _on_Area2D_area_entered(area):
if(area.is_in_group("Platform")):
grounded = true
emit_signal("landed")
func _on_Area2D_area_exited( area ):
if(area.is_in_group("Platform")):
grounded = false
Other Videos By NeoXid501
2018-03-19 | Slay the Spire - Episode 11 [Wounded] |
2018-03-17 | Slay the Spire - Episode 10 [Powerful] |
2018-03-15 | Slay the Spire - Episode 9 [03/03/2018 Daily Climb] |
2018-03-12 | Slay the Spire - Episode 8 [Relic the Moment] |
2018-03-11 | Godot 3.0 - Export Set Up |
2018-03-09 | Slay the Spire - Episode 7 [Reshuffle - Oops] |
2018-03-09 | Slay the Spire - Episode 6 [Times Up] |
2018-03-07 | Slay the Spire - Episode 5 [Greed] |
2018-03-05 | Slay the Spire - Episode 4 [Perfect] |
2018-03-02 | Slay the Spire - Episode 3 [Revenge] |
2018-03-01 | Godot 3.0 - GDScript Introduction |
2018-02-28 | Godot 3.0 - Scenes |
2018-02-28 | Godot 3.0 - Overview Tutorial |
2018-02-27 | Slay the Spire - Episode 2 [The Crow] |
2018-02-22 | Slay the Spire - Episode 1 [Emerald] |
2018-01-27 | Reccess Rabbit Rumble - Release Trailer |
2017-10-29 | Godot 2.1 - TROUBLESHOOTING Exporting |
2017-10-06 | Godot 2.1 - Importing and Exporting |
2017-10-01 | Godot 2.1 - Introduction Tutorial |
2017-08-03 | Developer Interview - Dave Galindo (@chubigans) [Cook, Serve, Delicious!] |
2017-07-28 | Bagel Bash - Promo Trailer |