Skip to content

Instantly share code, notes, and snippets.

View konchunas's full-sized avatar

Julian Konchunas konchunas

View GitHub Profile
fn has_even(numbers: Vec<i32>) -> bool {
for num in numbers {
if num % 2 == 0 {
return true;
}
}
return false;
}
fn main() {
let vec = vec![1, 9, 2, 5, 4];
@konchunas
konchunas / collision-shape-from-code.gd
Created April 5, 2020 14:10
Adds a CollisionShape to a StaticBody in GDScript
func create_collision():
var body = StaticBody.new()
var collision = CollisionShape.new()
var shape = CylinderShape.new()
shape.radius = 100
shape.height = 50
collision.set_shape(shape)
body.add_child(collision)
self.add_child(body)