All pastes #2062757 Raw Edit

Something

public text v1 · immutable
#2062757 ·published 2011-05-17 18:07 UTC
rendered paste body
int Space_collision_detection(Space space, float x, float y){
	// Check all stars
	List stars = space->stars;
	Star star = (Star)stars->val;
	while(star != NULL){
		if(Star_point_within(star, x, y))
			return 1;
		if(!List_empty(stars->suc)){
			stars = stars->suc;
			star = (Star)stars->val;
		} else
			star = NULL;
	}