mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2024-12-22 20:32:38 +01:00
Beginnings of a force-directed layout
This commit is contained in:
parent
f8c05fffb1
commit
0059b7b196
2 changed files with 8 additions and 2 deletions
2
main.gd
2
main.gd
|
@ -40,7 +40,7 @@ func git(args, splitlines = false):
|
||||||
var output = []
|
var output = []
|
||||||
var a = args.split(" ")
|
var a = args.split(" ")
|
||||||
a.insert(0, "-C")
|
a.insert(0, "-C")
|
||||||
a.insert(1, "/home/seb/tmp/godotgit")
|
a.insert(1, "/home/seb/wip/wurst-day-ever")
|
||||||
#print ("Running: ", a)
|
#print ("Running: ", a)
|
||||||
OS.execute("git", a, true, output, true)
|
OS.execute("git", a, true, output, true)
|
||||||
var o = output[0]
|
var o = output[0]
|
||||||
|
|
8
node.gd
8
node.gd
|
@ -12,7 +12,13 @@ func _ready():
|
||||||
pass
|
pass
|
||||||
|
|
||||||
func _process(delta):
|
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):
|
func id_set(new_id):
|
||||||
id = new_id
|
id = new_id
|
||||||
|
|
Loading…
Reference in a new issue