mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2024-11-29 21:45:09 +03:00
Beginnings of a force-directed layout
This commit is contained in:
parent
f8c05fffb1
commit
0059b7b196
2
main.gd
2
main.gd
@ -40,7 +40,7 @@ func git(args, splitlines = false):
|
||||
var output = []
|
||||
var a = args.split(" ")
|
||||
a.insert(0, "-C")
|
||||
a.insert(1, "/home/seb/tmp/godotgit")
|
||||
a.insert(1, "/home/seb/wip/wurst-day-ever")
|
||||
#print ("Running: ", a)
|
||||
OS.execute("git", a, true, output, true)
|
||||
var o = output[0]
|
||||
|
8
node.gd
8
node.gd
@ -12,7 +12,13 @@ func _ready():
|
||||
pass
|
||||
|
||||
func _process(delta):
|
||||
pass
|
||||
for c in children:
|
||||
var other = get_node("..").objects[c]
|
||||
var d = other.position.distance_to(position)
|
||||
var dir = (other.position - position).normalized()
|
||||
var f = ((d-400)*0.01)
|
||||
position += dir*f
|
||||
other.position -= dir*f
|
||||
|
||||
func id_set(new_id):
|
||||
id = new_id
|
||||
|
Loading…
Reference in New Issue
Block a user