Skip to content

Instantly share code, notes, and snippets.

from siege import Cooldown
from siege.util import seconds
from siege.component import Event
from core.template.item import Item, Material, CraftResult
from creamon.item.creaball import CreaballCapture
creaball = Item(
name = "Basic Creaball",
classification = "Crafted",
genus = "creaball",
extern crate rand;
extern crate graphics;
extern crate image;
extern crate sprite;
extern crate cgmath;
use std::rc::Rc;
use std::clone::Clone;
use std::path::PathBuf;
use std::borrow::Borrow;
@desophos
desophos / ChemotaxisEnv.py
Last active March 19, 2022 03:05
An agent that learns to chemotax using pybrain for neural networks and learning, pygame for graphics, and pymunk for physics.
from Food import Food
from Seeker import Seeker
from globals import SCREEN_SIZE, toPygame
from pybrain.rl.environments.environment import Environment
import pygame
class ChemotaxisEnv(Environment):
"""
Experiment adapted from "Evolving Dynamical Neural Networks for Adaptive Behavior" (Beer & Gallagher, 1992)
@desophos
desophos / Character.py
Created January 6, 2013 22:43
The beginnings of a ragdoll game.
from Gun import Gun
from globals import *
import pygame
import pymunk
class Character(pygame.sprite.Sprite):
""" Describes a moving character ingame made up of pymunk bodies/shapes. """
def __init__( self, body_type="ragdoll", w=10, h=10, m=1, mo=1, pos=(SCREEN_SIZE/2, SCREEN_SIZE/2) ):