Play experiment
Panel Curling's itch.io pageHow many characters of code did you use?
500
Include your code here, if you'd like to show it off!
extends Node2D
var n=RigidBody2D.new()
var v=Vector2(20,20)
var r="position"
var s=0:
set(a):s=a;t.text="%s"%s
var t=Label.new()
func f(a,b=self):b.add_child(a)
func l(j,d,b=600):d.position=Vector2(randi()%b,randi()%b);s+=8
func u(p=v,n=Area2D.new(),c=CollisionShape2D.new(),s=Tree.new()):c.shape=CircleShape2D.new();n[r]=p;s.size=v;f(c,n);f(s,n);n.body_entered.connect(l.bind(n));f(n)
func _init():n.gravity_scale=0;u(v,n);u();f(t)
func _input(e):if e.is_pressed():n.apply_force((e[r]-n[r])*9);s-=1
Leave a comment
Log in with itch.io to leave a comment.
Comments
No one has posted a comment yet