Skip to content

Instantly share code, notes, and snippets.

@shadmar
shadmar / QuadTree.cpp
Last active February 21, 2024 19:31
QuadTree implementation in C++ designed for use in spatial applications (maps)
//
// QuadTreeNode.cpp
//
// Created by Tomas Basham on 15/03/2014.
// Copyright (c) 2014 tomasbasham.co.uk. All rights reserved.
//
#include <iostream>
#include "QuadTree.h"
@shadmar
shadmar / Battle.lua
Last active December 14, 2015 01:29
Spawn 200 ships to battle close to you.
-- Copyright © 2008-2013 Pioneer Developers. See AUTHORS.txt for details
-- Licensed under the terms of the GPL v3. See licenses/GPL-3.txt
local scannedShips
local ships = {}
local maxships = 200
local killSomething = function(ship)
-- scan for ships and exclude itself and player, so we can just watch.
scannedShips = Space.GetBodies(function (body) return body:isa("Ship") and body ~= ship and body~=Game.player end)
if #scannedShips > 0 then