[map] Ratrace

The level/layout/play area.
2 posts Page 1 of 1 First unread post
learn_more
Coder
Coder
Posts: 891
Joined: Sun Mar 24, 2013 9:59 pm


This is one of the maps that Jojoe_Stinky made to demonstrate my minefield extension.
So obviously to use it on the server you should load this extension :)

In this map, everything outside the yellow/black border is a minefield.

ratrace.png
ratrace.png (548.7 KiB) Viewed 3085 times
Map script
Spoiler:
Code: Select all
AREA = (58, 153, 452, 356)
PAD = 5
WIDTH = 40
BLUE_RECT = (AREA[0] + PAD, AREA[1] + PAD, AREA[0] + PAD + WIDTH, AREA[3] - PAD)
GREEN_RECT = (AREA[2] - PAD - WIDTH, AREA[1] + PAD, AREA[2] - PAD, AREA[3] - PAD)
HALF_X = AREA[0] + (AREA[2] - AREA[0]) / 2
HALF_Y = AREA[1] + (AREA[3] - AREA[1]) / 2
GOAL = (8, 32, 40)
 
name = 'RatRace'
version = '1.0'
author = 'jojoe & learn_more'
area = AREA
ball = (HALF_X, HALF_Y, 40)

extensions = {
	'minefields' : [
		{
			'border' : 1,
			'left' : 58,
			'top' : 153,
			'right' : 452,
			'bottom' : 356,
		}
	]
}

minefield_required_version = 1.6	# we need atleast version 1.0 of the minefield script!!!
def on_map_change(self, map):
	minefield_ver = getattr(self, 'minefield_version', 0)
	if minefield_ver < minefield_required_version:
		msg = 'WARNING, THIS MAP NEEDS ATLEAST VERSION {0} OF THE MINEFIELD EXTENSION'.format(minefield_required_version)
		self.send_chat( msg, irc = True )
		print msg
		print 'Get it at: https://github.com/learn-more/pysnip/blob/master/scripts/minefield.py'

def get_spawn_location(connection):
    if connection.team is connection.protocol.blue_team:
        return connection.protocol.get_random_location(True, BLUE_RECT)
    elif connection.team is connection.protocol.green_team:
        return connection.protocol.get_random_location(True, GREEN_RECT)
 
from pyspades.constants import *
from pyspades.server import ServerConnection

def get_entity_location(team, entity_id):
    if entity_id == GREEN_FLAG:
        return (394, 238, 39)
    if entity_id == BLUE_FLAG:
        return (120, 270, 39)
    if entity_id == GREEN_BASE:
        return (394, 271, 39)
    if entity_id == BLUE_BASE:
        return (120, 239, 39)
Attachments
ratrace.rar
(502.37 KiB) Downloaded 264 times
Lincent
Veterans
Veterans
Posts: 693
Joined: Wed Mar 27, 2013 9:47 pm


It looks allot better than Jdrew's maps.
7/10
2 posts Page 1 of 1 First unread post
Return to “Maps”

Who is online

Users browsing this forum: No registered users and 7 guests