-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2001-11-30 14:28:30 GMT
- Loading branch information
0 parents
commit 567fc68
Showing
134 changed files
with
2,371 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
######################################################################### | ||
# 4st Attack # | ||
######################################################################### | ||
# Created by: # | ||
# Main programming - "slm" - Jeroen Vloothuis # | ||
# - Tjerk Nan # | ||
# Graphics - "The Corruptor" -- g@spank-the-monkey.org.uk # | ||
# Music - Tjerk Nan # | ||
######################################################################### | ||
# Specail thanks: # | ||
# "CrashChaos" - Frank Raiser for letting us nick his gui lib # | ||
# Everyone in #pygame and the opensource community in general # | ||
######################################################################### | ||
# This software is licensed under the GPL - General Public License # | ||
######################################################################### | ||
|
||
import os | ||
import pygame, pygame.font, pygame.image, pygame.mixer, pygame.transform | ||
from pygame.locals import * | ||
from startscreen import * | ||
import settings | ||
import profile | ||
|
||
settings = Settings() | ||
|
||
BACKGROUND_COLOR= (255,255,255,255) | ||
|
||
pygame.init() | ||
|
||
if settings.getGlobal()['sound']['music']=='yes': | ||
pygame.mixer.music.load(os.path.join('data', 'audio', settings.getTheme()['sound']['music'])) | ||
pygame.mixer.music.play(-1) | ||
|
||
# Declaration of the variables | ||
images = None | ||
screen = None | ||
file_names_images = { | ||
'grid' :'grid.png', | ||
'back' :'back.png', | ||
'stone1' :'stone_1.png', | ||
'stone2' :'stone_2.png', | ||
'selector' :'selector.png', | ||
'splash' :'splash.png', | ||
'won_1' :'won_1.png', | ||
'won_2' :'won_2.png', | ||
'background' :'background.png' | ||
} | ||
|
||
def setDisplay(): | ||
mode = DOUBLEBUF | ||
|
||
if(settings.getGlobal()['video']['fullscreen']=='yes'): | ||
mode = FULLSCREEN | ||
|
||
screen = pygame.display.set_mode( (int(settings.getGlobal()['video']['resolution_x']), | ||
int(settings.getGlobal()['video']['resolution_y'])), mode ) | ||
|
||
pygame.display.set_caption('4st Attack') | ||
pygame.mouse.set_visible(1) | ||
pygame.display.init() | ||
|
||
pygame.display.Info() | ||
return screen | ||
|
||
def loadGraphic(image_name, resolution): | ||
image_path = os.path.join('data', 'graphics', settings.getGlobal()['theme']['name'], | ||
resolution, image_name) | ||
image = pygame.image.load(image_path).convert_alpha() | ||
return image | ||
|
||
def loadGraphics(file_names, resolution): | ||
images = {} | ||
for key in file_names.keys(): | ||
images[key] = loadGraphic(file_names[key], resolution) | ||
return images | ||
|
||
def quit(): | ||
pygame.quit() | ||
os._exit(0) | ||
|
||
def main(): | ||
startscreen = StartScreen(screen, images, settings) | ||
startscreen.run() | ||
|
||
screen = setDisplay() | ||
images = loadGraphics(settings.getTheme()['images'], | ||
settings.getGlobal()['video']['resolution_x'] + 'x' + | ||
settings.getGlobal()['video']['resolution_y']) | ||
|
||
if __name__ == '__main__': | ||
main() |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
4st Attack | ||
|
||
If you have the windows version just slam the exe to run | ||
it. For other platforms, make sure you've installed | ||
Python(www.python.org) and Pygame(www.pygame.org). Then | ||
you can launch it by doing something like: | ||
python2 4stattack.py | ||
|
||
Have fun | ||
|
||
This program is licensed under the GPL. For more details | ||
read the GPL file in this dir. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import copy | ||
|
||
class Board: | ||
# Setup an empty board | ||
def __init__(self): | ||
self.state = [] | ||
for x in range(7): | ||
self.state.append([]) | ||
|
||
def move(self, move, player): | ||
self.state[move].append(player) | ||
self.last_move = move | ||
|
||
def domoves(self, moves): | ||
for (move, player) in moves: | ||
self.move(move, player) | ||
|
||
def undomove(self, move): | ||
if len(self.state[move]) > 0: | ||
del self.state[move][len(self.state[move])-1] |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
######################################################################### | ||
# 4st Attack # | ||
######################################################################### | ||
# Created by: # | ||
# Main programming - "slm" - Jeroen Vloothuis # | ||
# - Tjerk Nan # | ||
# Graphics - "The Corruptor" -- g@spank-the-monkey.org.uk # | ||
# Music - Tjerk Nan # | ||
######################################################################### | ||
# Specail thanks: # | ||
# "CrashChaos" - Frank Raiser for letting us nick his gui lib # | ||
# Everyone in #pygame and the opensource community in general # | ||
######################################################################### | ||
# This software is licensed under the GPL - General Public License # | ||
######################################################################### |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
[board] | ||
x = 162 | ||
y = 138 | ||
|
||
[startscreen] | ||
newgame_x = 360 | ||
newgame_y = 400 | ||
title_x = 200 | ||
title_y = 5 | ||
quit_x = 455 | ||
quit_y = 480 | ||
|
||
[gamescreen] | ||
quit_x = 10 | ||
quit_y = 10 | ||
column0_x = 162 | ||
column0_y = 20 | ||
column1_x = 262 | ||
column1_y = 20 | ||
column2_x = 362 | ||
column2_y = 20 | ||
column3_x = 462 | ||
column3_y = 20 | ||
column4_x = 562 | ||
column4_y = 20 | ||
column5_x = 662 | ||
column5_y = 20 | ||
column6_x = 762 | ||
column6_y = 20 | ||
|
||
[endscreen] | ||
winner_x = 0 | ||
winner_y = 0 | ||
return_x = 900 | ||
return_y = 699 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
[board] | ||
x = 101 | ||
y = 86 | ||
|
||
[startscreen] | ||
newgame_x = 225 | ||
newgame_y = 250 | ||
title_x = 125 | ||
title_y = 4 | ||
quit_x = 284 | ||
quit_y = 300 | ||
|
||
[gamescreen] | ||
column0_x = 101 | ||
column0_y = 13 | ||
column1_x = 163 | ||
column1_y = 13 | ||
column2_x = 225 | ||
column2_y = 13 | ||
column3_x = 287 | ||
column3_y = 13 | ||
column4_x = 349 | ||
column4_y = 13 | ||
column5_x = 411 | ||
column5_y = 13 | ||
column6_x = 473 | ||
column6_y = 13 | ||
|
||
[endscreen] | ||
winner_x = 0 | ||
winner_y = 0 | ||
return_x = 563 | ||
return_y = 437 |
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
[board] | ||
x = 127 | ||
y = 109 | ||
|
||
[startscreen] | ||
newgame_x = 281 | ||
newgame_y = 313 | ||
title_x = 156 | ||
title_y = 1 | ||
quit_x = 355 | ||
quit_y = 375 | ||
|
||
[gamescreen] | ||
quit_x = 8 | ||
quit_y = 8 | ||
column0_x = 127 | ||
column0_y = 16 | ||
column1_x = 205 | ||
column1_y = 16 | ||
column2_x = 283 | ||
column2_y = 16 | ||
column3_x = 361 | ||
column3_y = 16 | ||
column4_x = 439 | ||
column4_y = 16 | ||
column5_x = 517 | ||
column5_y = 16 | ||
column6_x = 595 | ||
column6_y = 16 | ||
|
||
[endscreen] | ||
winner_x = 0 | ||
winner_y = 0 | ||
return_x = 703 | ||
return_y = 547 |
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import gui | ||
import pygame | ||
from quit import * | ||
from game import * | ||
|
||
class EndScreen: | ||
def __init__(self, screen, images, settings, player): | ||
self.screen = screen | ||
self.images = images | ||
self.settings = settings | ||
self.exit_screen = 0 | ||
self.player = player | ||
|
||
def run(self): | ||
self.display() | ||
while 1: | ||
list=[] | ||
list.append(pygame.event.wait()) | ||
self.handler.update(list) | ||
if self.exit_screen: | ||
return | ||
|
||
def display(self): | ||
self.handler = gui.Handler() | ||
self.image = self.screen | ||
# Display the winner image | ||
self.image.blit(self.images['winner'+str(self.player)], ( | ||
int(self.settings.getLocations()['endscreen']['winner_x']), | ||
int(self.settings.getLocations()['endscreen']['winner_y']))) | ||
pygame.display.flip() | ||
|
||
self.handler.add(gui.Button( self.image, '', | ||
(int(self.settings.getLocations()['endscreen']['return_x']), | ||
int(self.settings.getLocations()['endscreen']['return_y']), | ||
self.images['b_return'].get_width(), self.images['b_return'].get_height()), | ||
background=self.images['b_return'], | ||
align='center', valign='center', | ||
onClick=self.return_to_main)) | ||
|
||
|
||
def return_to_main(self, event): | ||
self.exit_screen = 1 |
Binary file not shown.
Oops, something went wrong.