Skip to content

Commit

Permalink
4stAttack1.0.tar.gz
Browse files Browse the repository at this point in the history
2001-11-30 14:28:30 GMT
  • Loading branch information
Jeroen Vloothuis authored and 3D1T0R committed Nov 3, 2018
0 parents commit 567fc68
Show file tree
Hide file tree
Showing 134 changed files with 2,371 additions and 0 deletions.
91 changes: 91 additions & 0 deletions 4stattack.py
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()
340 changes: 340 additions & 0 deletions GPL

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions README.txt
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.
20 changes: 20 additions & 0 deletions board.py
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 added board.pyc
Binary file not shown.
15 changes: 15 additions & 0 deletions credits.txt
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 #
#########################################################################
Binary file added data/graphics/clean/1024x768/.thumbnails/back.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/graphics/clean/1024x768/.thumbnails/draw.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/graphics/clean/1024x768/.thumbnails/grid.png
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.
Binary file added data/graphics/clean/1024x768/.thumbnails/logo.png
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.
5 changes: 5 additions & 0 deletions data/graphics/clean/1024x768/.xvpics/background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/graphics/clean/1024x768/.xvpics/ok.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/graphics/clean/1024x768/back.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/graphics/clean/1024x768/background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/graphics/clean/1024x768/draw.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/graphics/clean/1024x768/grid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions data/graphics/clean/1024x768/locations.ini
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
Binary file added data/graphics/clean/1024x768/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/graphics/clean/1024x768/ok.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/graphics/clean/1024x768/quit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/graphics/clean/1024x768/selector.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/graphics/clean/1024x768/selector1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/graphics/clean/1024x768/selector2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/graphics/clean/1024x768/splash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/graphics/clean/1024x768/start.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/graphics/clean/1024x768/stone_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/graphics/clean/1024x768/stone_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/graphics/clean/1024x768/won_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/graphics/clean/1024x768/won_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/graphics/clean/640x480/back.png
Binary file added data/graphics/clean/640x480/background.png
Binary file added data/graphics/clean/640x480/draw.png
Binary file added data/graphics/clean/640x480/grid.png
33 changes: 33 additions & 0 deletions data/graphics/clean/640x480/locations.ini
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
Binary file added data/graphics/clean/640x480/logo.png
Binary file added data/graphics/clean/640x480/ok.png
Binary file added data/graphics/clean/640x480/quit.png
Binary file added data/graphics/clean/640x480/selector.png
Binary file added data/graphics/clean/640x480/selector1.png
Binary file added data/graphics/clean/640x480/selector2.png
Binary file added data/graphics/clean/640x480/splash.png
Binary file added data/graphics/clean/640x480/start.png
Binary file added data/graphics/clean/640x480/stone_1.png
Binary file added data/graphics/clean/640x480/stone_2.png
Binary file added data/graphics/clean/640x480/won_1.png
Binary file added data/graphics/clean/640x480/won_2.png
Binary file added data/graphics/clean/800x600/back.png
Binary file added data/graphics/clean/800x600/background.png
Binary file added data/graphics/clean/800x600/draw.png
Binary file added data/graphics/clean/800x600/grid.png
35 changes: 35 additions & 0 deletions data/graphics/clean/800x600/locations.ini
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
Binary file added data/graphics/clean/800x600/logo.png
Binary file added data/graphics/clean/800x600/ok.png
Binary file added data/graphics/clean/800x600/quit.png
Binary file added data/graphics/clean/800x600/selector.png
Binary file added data/graphics/clean/800x600/selector1.png
Binary file added data/graphics/clean/800x600/selector2.png
Binary file added data/graphics/clean/800x600/splash.png
Binary file added data/graphics/clean/800x600/start.png
Binary file added data/graphics/clean/800x600/stone_1.png
Binary file added data/graphics/clean/800x600/stone_2.png
Binary file added data/graphics/clean/800x600/won_1.png
Binary file added data/graphics/clean/800x600/won_2.png
42 changes: 42 additions & 0 deletions endscreen.py
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 added endscreen.pyc
Binary file not shown.
Loading

0 comments on commit 567fc68

Please sign in to comment.