This repository has been archived on 2024-02-25. You can view files and clone it, but cannot push or open issues or pull requests.
NotionGodot/Game.gd

31 lines
880 B
GDScript3
Raw Normal View History

2020-08-12 14:05:48 +02:00
extends Node
var table
func _ready():
$StaticBody2D/Polygon2D.polygon = $StaticBody2D/CollisionPolygon2D.polygon
$Notion.get_page()
table = $Notion.get_table('https://www.notion.so/4564a0a4d8b847919ad25ef705c097a1?v=9694b8b608634ea4bd802d83cddf0122')
func _on_Notion_block(id, block, _url):
if id == $Notion.blocks[0]:
var text = ''
for piece in block.value.properties.title:
text += piece[0]
$UI/RichTextLabel.text = text
func _on_Notion_data(data, return_id):
if table == return_id:
for row in data:
if row.Name == 'Movement speed':
$Player.movement_speed = int(row.Value)
if row.Name == 'Button label':
$UI/Button.text = row.Value
if row.Name == 'Jumping enabled':
$Player.jumping_enabled = row.Value.to_lower() == 'true'
func _on_Button_pressed():
var url = 'https://notion.so/' + $Notion.page.replace('-', '')
OS.shell_open(url)