Add preview of 1984-2019
The 2020 winners are hinted it, but the source code is not there,
nor are the hints. Someone could look into the HTML and
see what was commented out, but that is not a problem because
WHO won is known and the name of their AWARD is known already.
Moreover a number of the winners have talked about what their
entirs do, so the commented out spoiler text is not a bit problem.
One will find HTML commented out with:
<!-- XXX remove when 2020 is ready
2020 links here
XXX remove when 2020 is ready -->
The "XXX remove when 2020 is ready" string is found at the
start and end comment blocks. Again, soneone could read
what was commented out, but that is OK since most of that
information is known or can be known. The following files
have such HTML comment blocks in them.
./winners.html
./years-spoiler.html
./years.html
In addition, ./all/summary.txt was modified to not
include the 2020 entries for the momemt.
The 2020 winner code AND write-ups are NOT part of this set.
p.s. The all/all.tar.bz2 does not contain the 2020 source code (yet?).
This commit is contained in:
1 parent
28efc67f5d
commit
c0663537cb
1683 files changed
+220064
No files matched your search
@@ -0,0 +1,213 @@
|
||||
#!/usr/bin/env make
|
||||
#
|
||||
# 2014 makefile
|
||||
#
|
||||
# This work by Landon Curt Noll, Simon Cooper, and Leonid A. Broukhis
|
||||
# is licensed under:
|
||||
#
|
||||
# Creative Commons Attribution-ShareAlike 3.0 Unported License.
|
||||
#
|
||||
# See: http://creativecommons.org/licenses/by-sa/3.0/
|
||||
|
||||
|
||||
################
|
||||
# tool locations
|
||||
################
|
||||
#
|
||||
SHELL= /bin/bash
|
||||
CP= cp
|
||||
CPP= cpp
|
||||
GUNZIP= gunzip
|
||||
LD= ld
|
||||
MAKE= make
|
||||
RM= rm
|
||||
SED= sed
|
||||
TAR= tar
|
||||
TRUE= true
|
||||
|
||||
# Set X11_LIBDIR to the directory where the X11 library resides
|
||||
#
|
||||
X11_LIBDIR= /usr/X11R6/lib
|
||||
|
||||
# Set X11_INCLUDEDIR to the directory where the X11 include files reside
|
||||
#
|
||||
X11_INCDIR= /usr/X11R6/include
|
||||
|
||||
# Set SDL_LIBDIR to the directory where the SDL library resides
|
||||
#
|
||||
SDL_LIBDIR= $(shell sdl-config --libs)
|
||||
|
||||
# Set SDL_INCDIR to top level directory under where the SDL/SDL.h include file resides
|
||||
#
|
||||
SDL_INCDIR= $(shell sdl-config --cflags)
|
||||
|
||||
# Compiler warnings
|
||||
#
|
||||
#CWARN=
|
||||
CWARN= -Wall
|
||||
#CWARN= -Wall -pedantic
|
||||
|
||||
# compiler standard
|
||||
#
|
||||
#CSTD=
|
||||
#CSTD= -ansi
|
||||
CSTD= -std=c11
|
||||
|
||||
# compiler bit architecture
|
||||
#
|
||||
# Some entries require 32-bitness:
|
||||
# ARCH= -m32
|
||||
#
|
||||
# Some entries require 64-bitess:
|
||||
# ARCH= -m64
|
||||
#
|
||||
# By default we assume nothing:
|
||||
#
|
||||
ARCH=
|
||||
|
||||
# optimization
|
||||
#
|
||||
# Most compiles will safely use -O2. Some can use only -O1 or -O.
|
||||
# A few compilers have broken optimizers or this entry make break
|
||||
# under those buggy optimizers and thus you may not want anything.
|
||||
#
|
||||
#OPT=
|
||||
#OPT= -O
|
||||
#OPT= -O1
|
||||
OPT= -O2
|
||||
#OPT= -O3
|
||||
|
||||
# Libraries needed to build
|
||||
#
|
||||
LIBS= -lSDL
|
||||
|
||||
# default flags for ANSI C compilation
|
||||
#
|
||||
CFLAGS= ${CWARN} ${CSTD} ${ARCH} ${OPT}
|
||||
|
||||
# ANSI compiler
|
||||
#
|
||||
# Set CC to the name of your ANSI compiler.
|
||||
#
|
||||
# Some entries seem to need gcc. If you have gcc, set
|
||||
# both CC and MAY_NEED_GCC to gcc.
|
||||
#
|
||||
# If you do not have gcc, set CC to the name of your ANSI compiler, and
|
||||
# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just :
|
||||
# to disable such programs.
|
||||
#
|
||||
CC= cc
|
||||
#CC=clang
|
||||
MAY_NEED_GCC= gcc
|
||||
|
||||
|
||||
##############################
|
||||
# Special flags for this entry
|
||||
##############################
|
||||
#
|
||||
ENTRY= prog
|
||||
DATA=
|
||||
ALT_OBJ= prog.orig.o
|
||||
ALT_ENTRY= prog.orig
|
||||
|
||||
|
||||
#################
|
||||
# build the entry
|
||||
#################
|
||||
#
|
||||
all: ${ENTRY} ${DATA}
|
||||
@${TRUE}
|
||||
|
||||
${ENTRY}: ${ENTRY}.c
|
||||
${CC} ${CFLAGS} ${SDL_INCDIR} ${SDL_LIBDIR} $< -o $@ ${LIBS}
|
||||
|
||||
# alternative executable
|
||||
#
|
||||
alt: ${ALT_ENTRY}
|
||||
@${TRUE}
|
||||
|
||||
${ALT_ENTRY}: ${ALT_ENTRY}.c
|
||||
${CC} ${CFLAGS} ${SDL_INCDIR} ${SDL_LIBDIR} $< -o $@ ${LIBS}
|
||||
|
||||
# data files
|
||||
#
|
||||
data: ${DATA}
|
||||
@${TRUE}
|
||||
|
||||
|
||||
###############
|
||||
# utility rules
|
||||
###############
|
||||
#
|
||||
everything: all alt
|
||||
|
||||
clean:
|
||||
${RM} -f ${ENTRY}.o ${ALT_OBJ}
|
||||
|
||||
clobber: clean
|
||||
${RM} -f ${ENTRY} ${ALT_ENTRY}
|
||||
|
||||
nuke: clobber
|
||||
@${TRUE}
|
||||
|
||||
dist_clean: nuke
|
||||
@${TRUE}
|
||||
|
||||
install:
|
||||
@echo "Surely we are joking Dr. Science!"
|
||||
@${TRUE}
|
||||
|
||||
# backwards compatibility
|
||||
#
|
||||
build: all
|
||||
@${TRUE}
|
||||
|
||||
|
||||
##################
|
||||
# 133t hacker rulz
|
||||
##################
|
||||
#
|
||||
love:
|
||||
@echo 'not war?'
|
||||
@${TRUE}
|
||||
|
||||
haste:
|
||||
$(MAKE) waste
|
||||
@${TRUE}
|
||||
|
||||
waste:
|
||||
@echo 'haste'
|
||||
@${TRUE}
|
||||
|
||||
easter_egg:
|
||||
@echo you expected to sometimes mis-understand this $${RANDOM} magic
|
||||
@echo chongo '<was here>' "/\\oo/\\"
|
||||
@echo Readers shall not be disallowed from failong to be unable to not partly misunderstand this partocular final echo.
|
||||
|
||||
# Understand the history of the Homebrew Computer Club
|
||||
# as well as the West Coast Computer Faire and
|
||||
# you might be confused different. :-)
|
||||
#
|
||||
supernova: nuke
|
||||
@-if [ -r .code_anal ]; then \
|
||||
${RM} -f .code_anal_v4; \
|
||||
else \
|
||||
echo "We are not expected to understand that"; \
|
||||
fi
|
||||
@${TRUE}
|
||||
|
||||
deep_magic:
|
||||
@-if [ -r .code_anal ]; then \
|
||||
ccode_analysis --deep_magic 2ed3582ec5c094a093fea2a6bcb9f19439892873c9cc45ed1ceaafe08b7d52e1b2c7cd524be3b0b2 --FNV1a_hash 512-bit "${ENTRY}"; \
|
||||
else \
|
||||
echo "You are holding it wrong!"; \
|
||||
fi
|
||||
@${TRUE}
|
||||
|
||||
magic: deep_magic
|
||||
@-if [ -r .code_anal ]; then \
|
||||
ccode_analysis --mode 391581 --level 216193 --FNV1a_hash 512-bit "${ENTRY}"; \
|
||||
else \
|
||||
echo "These aren't the primes you're looking for Pauline!"; \
|
||||
fi
|
||||
@${TRUE}
|
||||
@@ -0,0 +1,162 @@
|
||||
0 276 46 2 0 0
|
||||
24 276 46 2 0 0
|
||||
48 276 46 2 0 0
|
||||
72 276 46 2 0 0
|
||||
96 276 46 2 0 0
|
||||
120 276 46 2 0 0
|
||||
144 276 46 2 0 0
|
||||
168 276 46 2 0 0
|
||||
192 276 46 2 0 0
|
||||
216 276 46 2 0 0
|
||||
240 276 46 2 0 0
|
||||
264 276 46 2 0 0
|
||||
288 276 46 2 0 0
|
||||
312 276 47 2 0 0
|
||||
|
||||
384 276 45 2 0 0
|
||||
408 276 46 2 0 0
|
||||
432 276 46 2 0 0
|
||||
456 276 46 2 0 0
|
||||
480 276 46 2 0 0
|
||||
504 276 47 2 0 0
|
||||
|
||||
456 252 27 2 0 0
|
||||
480 252 27 2 0 0
|
||||
504 252 27 2 0 0
|
||||
480 228 27 2 0 0
|
||||
504 228 27 2 0 0
|
||||
504 204 27 2 0 0
|
||||
|
||||
528 132 25 2 0 0
|
||||
552 132 25 2 0 0
|
||||
576 132 25 2 0 0
|
||||
600 132 25 2 0 0
|
||||
624 132 25 2 0 0
|
||||
648 132 25 2 0 0
|
||||
|
||||
576 200 39 64 0 0
|
||||
600 200 39 64 0 0
|
||||
624 200 39 64 0 0
|
||||
|
||||
576 224 39 64 0 0
|
||||
600 224 39 64 0 0
|
||||
624 224 39 64 0 0
|
||||
|
||||
672 132 27 2 0 0
|
||||
672 108 25 2 0 0
|
||||
|
||||
672 276 45 2 0 0
|
||||
696 276 46 2 0 0
|
||||
720 276 46 2 0 0
|
||||
744 276 46 2 0 0
|
||||
768 276 46 2 0 0
|
||||
792 276 46 2 0 0
|
||||
816 276 46 2 0 0
|
||||
840 276 46 2 0 0
|
||||
864 276 46 2 0 0
|
||||
888 276 46 2 0 0
|
||||
912 276 46 2 0 0
|
||||
936 276 46 2 0 0
|
||||
960 276 46 2 0 0
|
||||
984 276 46 2 0 0
|
||||
|
||||
792 180 25 2 0 0
|
||||
816 180 27 2 0 0
|
||||
816 156 25 2 0 0
|
||||
840 156 27 2 0 0
|
||||
840 132 25 2 0 0
|
||||
864 132 25 2 0 0
|
||||
888 132 25 2 0 0
|
||||
912 132 25 2 0 0
|
||||
936 132 25 2 0 0
|
||||
960 132 25 2 0 0
|
||||
984 132 25 2 0 0
|
||||
|
||||
936 84 33 0 0 0
|
||||
960 84 34 0 0 0
|
||||
984 84 35 0 0 0
|
||||
936 108 41 0 0 0
|
||||
960 108 42 0 0 0
|
||||
960 108 42 16 0 0
|
||||
984 108 43 0 0 0
|
||||
|
||||
696 252 30 2 0 0
|
||||
720 252 31 2 0 0
|
||||
696 228 30 2 0 0
|
||||
720 228 31 2 0 0
|
||||
|
||||
96 204 25 130 0 0
|
||||
120 204 26 4 8 19
|
||||
144 204 25 2 0 0
|
||||
168 204 26 4 64 39
|
||||
192 204 26 4 64 39
|
||||
216 204 25 2 0 0
|
||||
|
||||
24 60 28 0 0 0
|
||||
48 60 29 0 0 0
|
||||
|
||||
48 120 28 0 0 0
|
||||
72 120 29 0 0 0
|
||||
|
||||
140 90 28 0 0 0
|
||||
164 90 29 0 0 0
|
||||
|
||||
192 40 28 0 0 0
|
||||
216 40 29 0 0 0
|
||||
|
||||
384 120 28 0 0 0
|
||||
408 120 29 0 0 0
|
||||
|
||||
442 20 28 0 0 0
|
||||
466 20 29 0 0 0
|
||||
|
||||
744 90 28 0 0 0
|
||||
768 90 29 0 0 0
|
||||
|
||||
792 40 28 0 0 0
|
||||
816 40 29 0 0 0
|
||||
|
||||
192 132 26 4 64 39
|
||||
216 132 25 2 0 0
|
||||
240 132 25 2 0 0
|
||||
264 132 25 2 0 0
|
||||
|
||||
528 60 26 4 64 39
|
||||
552 60 26 4 64 39
|
||||
|
||||
332 84 25 2 0 0
|
||||
356 84 27 2 0 0
|
||||
356 60 25 2 0 0
|
||||
380 60 25 2 0 0
|
||||
404 60 25 2 0 0
|
||||
|
||||
356 0 39 64 0 0
|
||||
380 0 39 64 0 0
|
||||
404 0 39 64 0 0
|
||||
|
||||
48 252 22 0 0 0
|
||||
72 252 23 0 0 0
|
||||
|
||||
730 252 22 0 0 0
|
||||
754 252 23 0 0 0
|
||||
|
||||
144 252 20 0 0 0
|
||||
168 252 21 0 0 0
|
||||
|
||||
900 252 20 0 0 0
|
||||
924 252 21 0 0 0
|
||||
|
||||
384 252 20 0 0 0
|
||||
408 252 21 0 0 0
|
||||
|
||||
240 252 17 1 1 0
|
||||
|
||||
202 108 17 1 1 0
|
||||
|
||||
624 108 17 1 -1 0
|
||||
|
||||
800 252 17 1 1 0
|
||||
|
||||
16 252 0 0 0 0
|
||||
|
||||
-1 -1 -1 -1 -1 -1
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,329 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta name="GENERATOR" content="mkd2html 2.1.5a DL=DISCOUNT">
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
|
||||
<link rel="stylesheet"
|
||||
type="text/css"
|
||||
href="../hint.css">
|
||||
<title>Homage to a classic game</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Homage to a classic game</h1>
|
||||
|
||||
<p>Sandro Maffiodo<br>
|
||||
<a href="mailto:smaffer@gmail.com">smaffer@gmail.com</a><br>
|
||||
<a href="http://www.assezeta.com/sandromaffiodo">http://www.assezeta.com/sandromaffiodo</a></p>
|
||||
|
||||
<h2>Judges' comments:</h2>
|
||||
|
||||
<h3>To build:</h3>
|
||||
|
||||
<pre><code>make
|
||||
</code></pre>
|
||||
|
||||
<h3>To run:</h3>
|
||||
|
||||
<pre><code>cat mario.level | ./prog 320 200 800 300 128 144 mario.rgba mario8.wav 10343679
|
||||
</code></pre>
|
||||
|
||||
<h3>Try:</h3>
|
||||
|
||||
<pre><code>cat giana.level | ./prog 320 200 1000 300 192 168 giana.rgba giana8.wav 5459393
|
||||
|
||||
cat mario.level | ./prog 320 200 800 300 128 144 mario.rgba mario8.wav 10343679 && telnet towel.blinkenlights.nl
|
||||
</code></pre>
|
||||
|
||||
<h3>Selected Judges Remarks:</h3>
|
||||
|
||||
<p>A classic for a particular generation. Like all good programs, being data
|
||||
driven means you can do fun things in small spaces.</p>
|
||||
|
||||
<h2>Author’s comments:</h2>
|
||||
|
||||
<h3>Remarks</h3>
|
||||
|
||||
<p>Use tabsize=4 to see the magic</p>
|
||||
|
||||
<pre><code>./expand -t 4 < prog.c
|
||||
</code></pre>
|
||||
|
||||
<p>The program returns 0 if the user win or <em>not-zero</em> if loose so you can test it and make something useful (or not), like that:</p>
|
||||
|
||||
<pre><code>cat mario.level | ./prog 320 200 800 300 128 144 mario.rgba mario8.wav 10343679 && telnet towel.blinkenlights.nl
|
||||
</code></pre>
|
||||
|
||||
<p>This is an engine for <strong>Platform Games</strong>. It can be used to create games like the legendary <a href="http://en.wikipedia.org/wiki/Super_Mario_Bros.">Super Mario Bros</a>.
|
||||
With this simple and clear sourcecode you can create all the games you want, for free!</p>
|
||||
|
||||
<p>In my two tests i tried to create one level of <a href="http://en.wikipedia.org/wiki/Super_Mario_Bros.">Super Mario Bros</a> and one of <a href="http://en.wikipedia.org/wiki/The_Great_Giana_Sisters">The Great Giana The Sisters</a>.
|
||||
Both games are classic <em>platform games</em> and both share the same fundamental rules:</p>
|
||||
|
||||
<ul>
|
||||
<li>there is a player</li>
|
||||
<li>there is a powerup that can change the look of the player and/or give to him/her more power!</li>
|
||||
<li>there are walls, floors and ceilings. the player can move and jump over these type of obstacles but cannot walk through them</li>
|
||||
<li>there are enemies and, if the player collides with an enemy, the player dies or loses its powers</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h3>Regards running under Mac OS X</h3>
|
||||
|
||||
<p>The color of the sky is wrong on MacOS. You need to flip some bytes from the last parameter of the program:</p>
|
||||
|
||||
<pre><code>MARIO LAST PARAMETER: 4292124159
|
||||
|
||||
GIANA LAST PARAMETER: 3243070463
|
||||
</code></pre>
|
||||
|
||||
<h3>Regarding how to compile</h3>
|
||||
|
||||
<p>The code requires libSDL1.X.</p>
|
||||
|
||||
<p>The build process will generate some warnings (60~ on clang) about:</p>
|
||||
|
||||
<ul>
|
||||
<li><strong>incompatible pointer types</strong>: because all pointers are declared to <em>int</em> or <em>char</em>, to save tokens</li>
|
||||
<li><strong>type specifier missing, defaults to ‘int’</strong>: because i need to save tokens</li>
|
||||
<li><strong>using the result of an assignment as a condition without parentheses</strong>: because while(c=getchar()) is not evil</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h3>How it works</h3>
|
||||
|
||||
<h2>Parameters</h2>
|
||||
|
||||
<ol>
|
||||
<li>Window width</li>
|
||||
<li>Window height</li>
|
||||
<li>Level width</li>
|
||||
<li>Level height</li>
|
||||
<li>Sprites image width</li>
|
||||
<li>Sprites image height</li>
|
||||
<li>Filename of the sprites image (raw RGBA image)</li>
|
||||
<li>Filename of the music (WAVE 8000 Hz 8bit Mono)</li>
|
||||
<li>Sky color. This number depends on the system where you run the program. See <strong>NOTE on MacOS</strong></li>
|
||||
</ol>
|
||||
|
||||
|
||||
<h2>Sprites</h2>
|
||||
|
||||
<p>The program read a single image that contains all the game sprites. The image must be a grid of 8xN sprites. The size of a single sprite must be square. The program calculates the size in this way:</p>
|
||||
|
||||
<pre><code>sprite_size = image_width / 8
|
||||
</code></pre>
|
||||
|
||||
<p>Each sprite is identified by its position inside the grid, counting line by line, from left to right (for example sprite 0 is the top left sprite in the grid, sprite 8 is the first sprite of the second row of the grid).</p>
|
||||
|
||||
<p>Some positions of the grid have a predefined purpose:</p>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th align="left">Position </th>
|
||||
<th align="left"> Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td align="left">0 </td>
|
||||
<td align="left"> Player stand right</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left">1 </td>
|
||||
<td align="left"> Player walk right frame 0</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left">2 </td>
|
||||
<td align="left"> Player walk right frame 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left">3 </td>
|
||||
<td align="left"> Player jump right</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left">4 </td>
|
||||
<td align="left"> Player stand left</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left">5 </td>
|
||||
<td align="left"> Player walk left frame 0</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left">6 </td>
|
||||
<td align="left"> Player walk left frame 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left">7 </td>
|
||||
<td align="left"> Player jump left</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left">8 <em>(second row)</em> </td>
|
||||
<td align="left"> Super player stand right</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left">9 </td>
|
||||
<td align="left"> Super player walk right frame 0</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left">10 </td>
|
||||
<td align="left"> Super player walk right frame 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left">11 </td>
|
||||
<td align="left"> Super player jump right</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left">12 </td>
|
||||
<td align="left"> Super player stand left</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left">13 </td>
|
||||
<td align="left"> Super player walk left frame 0</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left">14 </td>
|
||||
<td align="left"> Super player walk left frame 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left">15 </td>
|
||||
<td align="left"> Super player jump left</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left">24 </td>
|
||||
<td align="left"> Player dead</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left">32 </td>
|
||||
<td align="left"> Player win</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left">40 </td>
|
||||
<td align="left"> Super player win</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
<p>All the others sprites can be used as you want, depending on the game you want to create.</p>
|
||||
|
||||
<h2>Levels</h2>
|
||||
|
||||
<p>The program reads the level description from <strong>stdin</strong>.</p>
|
||||
|
||||
<p>The level description is a sequence of rows where each row describe an object. You can input as many objects as you want but the maximum number of objects handled by the program is 333. You can modify this value by editing the source here:</p>
|
||||
|
||||
<pre><code>C[333*7],d=333;
|
||||
</code></pre>
|
||||
|
||||
<p>Each row have six columns:</p>
|
||||
|
||||
<ol>
|
||||
<li>Screen X: x position of the object in the level</li>
|
||||
<li>Screen Y: y position of the object in the level</li>
|
||||
<li>Sprite: id of the sprite to be used for the object</li>
|
||||
<li>CLASSFLAGS: a bitmask that describe how the object behaves</li>
|
||||
<li>CLASSPARAM0: a parameter that depends on CLASSFLAGS</li>
|
||||
<li>CLASSPARAM1: a parameter that depends on CLASSFLAGS</li>
|
||||
</ol>
|
||||
|
||||
|
||||
<p>CLASSFLAGS must be a combination (bitwise or) of some of these constants:</p>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th align="left">NAME </th>
|
||||
<th align="left"> CONSTANT </th>
|
||||
<th align="left"> CLASS</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td align="left">ENEMY </td>
|
||||
<td align="left"> 1 </td>
|
||||
<td align="left"> An enemy. CLASSPARAM0 can be 0 if the enemy don’t move, 1 if the initial move direction is right, -1 if direction is left. All enemies that walk will change its direction after 20 pixels. The sprite of an enemy must have 2 others adjacent sprites: SPRITE-1, used when the enemy die, and SPRITE+1, used when it walks</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left">BLOCK </td>
|
||||
<td align="left"> 2 </td>
|
||||
<td align="left"> A wall. Player can walk over the object but can not pass through it</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left">GIFT BLOCK </td>
|
||||
<td align="left"> 4 </td>
|
||||
<td align="left"> When the player hits the object from below, a new object is created. CLASSFLAGS of the new object is defined in CLASSPARAM0. The sprite used for the new object is defined in CLASSPARAM1. The sprite of the gift object must have an adjacent sprite: SPRITE+1, used when the block is hit</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left">POWERUP </td>
|
||||
<td align="left"> 8 </td>
|
||||
<td align="left"> This is the classic Mario’s mushroom. When the player hit the powerup object, the player become <em>Super player</em>. If CLASSFLAGS has the bit ZOOM, the player height will be doubled.<br>The <em>Super player</em> can hit the enemies without die, but when this happens, the <em>Super player</em> goes back to being normal</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left">END </td>
|
||||
<td align="left"> 16 </td>
|
||||
<td align="left"> When the player hits this object the level ends. Player win</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left">ZOOM </td>
|
||||
<td align="left"> 32 </td>
|
||||
<td align="left"> This flag can be used with POWERUP to indicate a powerup that will doubles the size of the player (like Mario’s mushroom)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left">DESTROY </td>
|
||||
<td align="left"> 64 </td>
|
||||
<td align="left"> When the player hits the object the object disappear. This is the classic Mario’s coin, but the engine does not counts the points, so, from the user point of view, this object is useless</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left">DESTROYUP </td>
|
||||
<td align="left"> 128 </td>
|
||||
<td align="left"> This object is like a BLOCK but when the player hits the object from below, the object disappear</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
<p>If CLASSFLAGS is zero the object has only an aesthetic function.</p>
|
||||
|
||||
<p>The last row of the level descriptor must have all its columns set equal to -1.</p>
|
||||
|
||||
<h3>Limitations</h3>
|
||||
|
||||
<p>Some classical features are missing: throw objects, shoot, multiple lives, points counter. You can add those features if you want!</p>
|
||||
|
||||
<p>The program allow to run one level only. It’s easy to add a menu and multiple levels but the size of the engine will grow too much.</p>
|
||||
|
||||
<p>When the <em>Super player</em> become bigger (ZOOM flag), the player can collide with blocks and get stuck inside them. This is a KNOWN BUG. When your player become bigger, stay away from blocks!</p>
|
||||
|
||||
<p>There is one audio track only (game effects are missing).</p>
|
||||
|
||||
<h3>Credits</h3>
|
||||
|
||||
<p>Some of the sprites used in the examples are identical to those of the original games, others were designed by me.</p>
|
||||
|
||||
<p>The music used in the examples have been resampled, starting from the original versions for the <a href="http://en.wikipedia.org/wiki/Amiga">Commodore Amiga</a> and <a href="http://en.wikipedia.org/wiki/Nintendo_Entertainment_System">Nintendo NES</a>.</p>
|
||||
|
||||
<p><a href="http://en.wikipedia.org/wiki/Super_Mario_Bros.">Super Mario Bros</a> is a game created by Nintendo Entertainment, my use of the sprites does not intend to infringe the intellectual property of Nintendo but only demonstrate the operation of the program. From my point of view this is a tribute to the legendary game <a href="http://en.wikipedia.org/wiki/Super_Mario_Bros.">Super Mario Bros</a>!</p>
|
||||
|
||||
<p><a href="http://en.wikipedia.org/wiki/The_Great_Giana_Sisters">The Great Giana The Sisters</a> is the game created by Time Warp Productions and also for this game worth my previous notes. Long live <a href="http://en.wikipedia.org/wiki/The_Great_Giana_Sisters">The Great Giana The Sisters</a> !! :)</p>
|
||||
|
||||
<hr />
|
||||
|
||||
<!--
|
||||
(c) Copyright 1984-2015, [Leo Broukhis, Simon Cooper, Landon Curt Noll][judges] - All rights reserved
|
||||
This work is licensed under a [Creative Commons Attribution-ShareAlike 3.0 Unported License][cc].
|
||||
|
||||
[judges]: http://www.ioccc.org/judges.html
|
||||
[cc]: http://creativecommons.org/licenses/by-sa/3.0/
|
||||
-->
|
||||
|
||||
<TABLE><TR>
|
||||
<TD><a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-sa/3.0/88x31.png" /></a></TD>
|
||||
<TD><P>© Copyright 1984-2015,
|
||||
<A HREF="/judges.html">Leo Broukhis, Simon Cooper, Landon Curt Noll</A>
|
||||
- All rights reserved<BR>
|
||||
This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/">Creative Commons Attribution-ShareAlike 3.0 Unported License</a>.</P></TD>
|
||||
<TD> <!--<a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01 Transitional" height="31" width="88"></a>--></TD>
|
||||
</TR></TABLE>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,177 @@
|
||||
# Homage to a classic game
|
||||
|
||||
Sandro Maffiodo
|
||||
<smaffer@gmail.com>
|
||||
<http://www.assezeta.com/sandromaffiodo>
|
||||
|
||||
|
||||
## Judges' comments:
|
||||
### To build:
|
||||
|
||||
make
|
||||
|
||||
### To run:
|
||||
|
||||
cat mario.level | ./prog 320 200 800 300 128 144 mario.rgba mario8.wav 10343679
|
||||
|
||||
### Try:
|
||||
|
||||
cat giana.level | ./prog 320 200 1000 300 192 168 giana.rgba giana8.wav 5459393
|
||||
|
||||
cat mario.level | ./prog 320 200 800 300 128 144 mario.rgba mario8.wav 10343679 && telnet towel.blinkenlights.nl
|
||||
|
||||
### Selected Judges Remarks:
|
||||
|
||||
A classic for a particular generation. Like all good programs, being data
|
||||
driven means you can do fun things in small spaces.
|
||||
|
||||
## Author's comments:
|
||||
### Remarks
|
||||
|
||||
Use tabsize=4 to see the magic
|
||||
|
||||
./expand -t 4 < prog.c
|
||||
|
||||
The program returns 0 if the user win or *not-zero* if loose so you can test it and make something useful (or not), like that:
|
||||
|
||||
cat mario.level | ./prog 320 200 800 300 128 144 mario.rgba mario8.wav 10343679 && telnet towel.blinkenlights.nl
|
||||
|
||||
This is an engine for **Platform Games**. It can be used to create games like the legendary [Super Mario Bros](http://en.wikipedia.org/wiki/Super_Mario_Bros.).
|
||||
With this simple and clear sourcecode you can create all the games you want, for free!
|
||||
|
||||
In my two tests i tried to create one level of [Super Mario Bros](http://en.wikipedia.org/wiki/Super_Mario_Bros.) and one of [The Great Giana The Sisters](http://en.wikipedia.org/wiki/The_Great_Giana_Sisters).
|
||||
Both games are classic *platform games* and both share the same fundamental rules:
|
||||
|
||||
- there is a player
|
||||
- there is a powerup that can change the look of the player and/or give to him/her more power!
|
||||
- there are walls, floors and ceilings. the player can move and jump over these type of obstacles but cannot walk through them
|
||||
- there are enemies and, if the player collides with an enemy, the player dies or loses its powers
|
||||
|
||||
### Regards running under Mac OS X
|
||||
|
||||
The color of the sky is wrong on MacOS. You need to flip some bytes from the last parameter of the program:
|
||||
|
||||
MARIO LAST PARAMETER: 4292124159
|
||||
|
||||
GIANA LAST PARAMETER: 3243070463
|
||||
|
||||
### Regarding how to compile
|
||||
|
||||
The code requires libSDL1.X.
|
||||
|
||||
The build process will generate some warnings (60~ on clang) about:
|
||||
|
||||
- **incompatible pointer types**: because all pointers are declared to *int* or *char*, to save tokens
|
||||
- **type specifier missing, defaults to 'int'**: because i need to save tokens
|
||||
- **using the result of an assignment as a condition without parentheses**: because while(c=getchar()) is not evil
|
||||
|
||||
### How it works
|
||||
|
||||
## Parameters
|
||||
|
||||
1. Window width
|
||||
2. Window height
|
||||
3. Level width
|
||||
4. Level height
|
||||
5. Sprites image width
|
||||
6. Sprites image height
|
||||
7. Filename of the sprites image (raw RGBA image)
|
||||
8. Filename of the music (WAVE 8000 Hz 8bit Mono)
|
||||
9. Sky color. This number depends on the system where you run the program. See **NOTE on MacOS**
|
||||
|
||||
## Sprites
|
||||
|
||||
The program read a single image that contains all the game sprites. The image must be a grid of 8xN sprites. The size of a single sprite must be square. The program calculates the size in this way:
|
||||
|
||||
sprite_size = image_width / 8
|
||||
|
||||
Each sprite is identified by its position inside the grid, counting line by line, from left to right (for example sprite 0 is the top left sprite in the grid, sprite 8 is the first sprite of the second row of the grid).
|
||||
|
||||
Some positions of the grid have a predefined purpose:
|
||||
|
||||
Position | Description
|
||||
:-----------------|:--------------
|
||||
0 | Player stand right
|
||||
1 | Player walk right frame 0
|
||||
2 | Player walk right frame 1
|
||||
3 | Player jump right
|
||||
4 | Player stand left
|
||||
5 | Player walk left frame 0
|
||||
6 | Player walk left frame 1
|
||||
7 | Player jump left
|
||||
8 *(second row)* | Super player stand right
|
||||
9 | Super player walk right frame 0
|
||||
10 | Super player walk right frame 1
|
||||
11 | Super player jump right
|
||||
12 | Super player stand left
|
||||
13 | Super player walk left frame 0
|
||||
14 | Super player walk left frame 1
|
||||
15 | Super player jump left
|
||||
24 | Player dead
|
||||
32 | Player win
|
||||
40 | Super player win
|
||||
|
||||
All the others sprites can be used as you want, depending on the game you want to create.
|
||||
|
||||
## Levels
|
||||
|
||||
The program reads the level description from **stdin**.
|
||||
|
||||
The level description is a sequence of rows where each row describe an object. You can input as many objects as you want but the maximum number of objects handled by the program is 333. You can modify this value by editing the source here:
|
||||
|
||||
C[333*7],d=333;
|
||||
|
||||
Each row have six columns:
|
||||
|
||||
1. Screen X: x position of the object in the level
|
||||
2. Screen Y: y position of the object in the level
|
||||
3. Sprite: id of the sprite to be used for the object
|
||||
4. CLASSFLAGS: a bitmask that describe how the object behaves
|
||||
5. CLASSPARAM0: a parameter that depends on CLASSFLAGS
|
||||
6. CLASSPARAM1: a parameter that depends on CLASSFLAGS
|
||||
|
||||
CLASSFLAGS must be a combination (bitwise or) of some of these constants:
|
||||
|
||||
NAME | CONSTANT | CLASS
|
||||
:----------|:----------|:---------
|
||||
ENEMY | 1 | An enemy. CLASSPARAM0 can be 0 if the enemy don't move, 1 if the initial move direction is right, -1 if direction is left. All enemies that walk will change its direction after 20 pixels. The sprite of an enemy must have 2 others adjacent sprites: SPRITE-1, used when the enemy die, and SPRITE+1, used when it walks
|
||||
BLOCK | 2 | A wall. Player can walk over the object but can not pass through it
|
||||
GIFT BLOCK | 4 | When the player hits the object from below, a new object is created. CLASSFLAGS of the new object is defined in CLASSPARAM0. The sprite used for the new object is defined in CLASSPARAM1. The sprite of the gift object must have an adjacent sprite: SPRITE+1, used when the block is hit
|
||||
POWERUP | 8 | This is the classic Mario's mushroom. When the player hit the powerup object, the player become *Super player*. If CLASSFLAGS has the bit ZOOM, the player height will be doubled.<br>The *Super player* can hit the enemies without die, but when this happens, the *Super player* goes back to being normal
|
||||
END | 16 | When the player hits this object the level ends. Player win
|
||||
ZOOM | 32 | This flag can be used with POWERUP to indicate a powerup that will doubles the size of the player (like Mario's mushroom)
|
||||
DESTROY | 64 | When the player hits the object the object disappear. This is the classic Mario's coin, but the engine does not counts the points, so, from the user point of view, this object is useless
|
||||
DESTROYUP | 128 | This object is like a BLOCK but when the player hits the object from below, the object disappear
|
||||
|
||||
If CLASSFLAGS is zero the object has only an aesthetic function.
|
||||
|
||||
The last row of the level descriptor must have all its columns set equal to -1.
|
||||
|
||||
### Limitations
|
||||
|
||||
Some classical features are missing: throw objects, shoot, multiple lives, points counter. You can add those features if you want!
|
||||
|
||||
The program allow to run one level only. It's easy to add a menu and multiple levels but the size of the engine will grow too much.
|
||||
|
||||
When the *Super player* become bigger (ZOOM flag), the player can collide with blocks and get stuck inside them. This is a KNOWN BUG. When your player become bigger, stay away from blocks!
|
||||
|
||||
There is one audio track only (game effects are missing).
|
||||
|
||||
### Credits
|
||||
|
||||
Some of the sprites used in the examples are identical to those of the original games, others were designed by me.
|
||||
|
||||
The music used in the examples have been resampled, starting from the original versions for the [Commodore Amiga](http://en.wikipedia.org/wiki/Amiga) and [Nintendo NES](http://en.wikipedia.org/wiki/Nintendo_Entertainment_System).
|
||||
|
||||
[Super Mario Bros](http://en.wikipedia.org/wiki/Super_Mario_Bros.) is a game created by Nintendo Entertainment, my use of the sprites does not intend to infringe the intellectual property of Nintendo but only demonstrate the operation of the program. From my point of view this is a tribute to the legendary game [Super Mario Bros](http://en.wikipedia.org/wiki/Super_Mario_Bros.)!
|
||||
|
||||
[The Great Giana The Sisters](http://en.wikipedia.org/wiki/The_Great_Giana_Sisters) is the game created by Time Warp Productions and also for this game worth my previous notes. Long live [The Great Giana The Sisters](http://en.wikipedia.org/wiki/The_Great_Giana_Sisters) !! :)
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
<!--
|
||||
(c) Copyright 1984-2015, [Leo Broukhis, Simon Cooper, Landon Curt Noll][judges] - All rights reserved
|
||||
This work is licensed under a [Creative Commons Attribution-ShareAlike 3.0 Unported License][cc].
|
||||
|
||||
[judges]: http://www.ioccc.org/judges.html
|
||||
[cc]: http://creativecommons.org/licenses/by-sa/3.0/
|
||||
-->
|
||||
@@ -0,0 +1,205 @@
|
||||
0 284 34 2 0 0
|
||||
16 284 34 2 0 0
|
||||
32 284 34 2 0 0
|
||||
48 284 34 2 0 0
|
||||
64 284 34 2 0 0
|
||||
80 284 34 2 0 0
|
||||
96 284 34 2 0 0
|
||||
112 284 34 2 0 0
|
||||
128 284 34 2 0 0
|
||||
144 284 34 2 0 0
|
||||
160 284 34 2 0 0
|
||||
176 284 34 2 0 0
|
||||
192 284 34 2 0 0
|
||||
208 284 34 2 0 0
|
||||
224 284 34 2 0 0
|
||||
240 284 34 2 0 0
|
||||
256 284 34 2 0 0
|
||||
272 284 35 2 0 0
|
||||
|
||||
112 268 30 1 1 0
|
||||
|
||||
320 284 41 2 0 0
|
||||
|
||||
352 284 41 2 0 0
|
||||
|
||||
400 284 33 2 0 0
|
||||
416 284 34 2 0 0
|
||||
432 284 34 2 0 0
|
||||
448 284 34 2 0 0
|
||||
464 284 34 2 0 0
|
||||
480 284 34 2 0 0
|
||||
496 284 34 2 0 0
|
||||
512 284 34 2 0 0
|
||||
528 284 34 2 0 0
|
||||
544 284 34 2 0 0
|
||||
560 284 34 2 0 0
|
||||
576 284 34 2 0 0
|
||||
592 284 35 2 0 0
|
||||
|
||||
624 148 49 2 0 0
|
||||
624 164 49 2 0 0
|
||||
624 180 49 2 0 0
|
||||
640 180 49 2 0 0
|
||||
624 196 49 2 0 0
|
||||
640 196 49 2 0 0
|
||||
656 196 49 2 0 0
|
||||
624 212 50 2 0 0
|
||||
640 212 50 2 0 0
|
||||
656 212 50 2 0 0
|
||||
|
||||
672 284 53 2 0 0
|
||||
688 284 53 2 0 0
|
||||
704 284 53 2 0 0
|
||||
720 284 53 2 0 0
|
||||
736 284 53 2 0 0
|
||||
752 284 53 2 0 0
|
||||
768 284 53 2 0 0
|
||||
784 284 53 2 0 0
|
||||
|
||||
32 148 64 0 0 0
|
||||
48 148 66 0 0 0
|
||||
|
||||
80 92 64 0 0 0
|
||||
96 92 66 0 0 0
|
||||
|
||||
112 132 64 0 0 0
|
||||
128 132 65 0 0 0
|
||||
144 132 66 0 0 0
|
||||
|
||||
176 92 64 0 0 0
|
||||
192 92 65 0 0 0
|
||||
208 92 66 0 0 0
|
||||
|
||||
224 152 64 0 0 0
|
||||
240 152 66 0 0 0
|
||||
|
||||
240 32 64 0 0 0
|
||||
256 32 66 0 0 0
|
||||
|
||||
320 92 64 0 0 0
|
||||
336 92 66 0 0 0
|
||||
|
||||
384 108 64 0 0 0
|
||||
400 108 65 0 0 0
|
||||
416 108 66 0 0 0
|
||||
|
||||
416 32 64 0 0 0
|
||||
432 32 66 0 0 0
|
||||
|
||||
288 196 25 2 0 0
|
||||
304 196 25 2 0 0
|
||||
320 196 25 130 0 0
|
||||
336 196 25 2 0 0
|
||||
352 196 25 2 0 0
|
||||
|
||||
350 180 30 1 -1 0
|
||||
|
||||
512 66 51 2 0 0
|
||||
528 66 52 2 0 0
|
||||
544 66 50 2 0 0
|
||||
560 66 51 2 0 0
|
||||
576 66 52 2 0 0
|
||||
592 66 50 2 0 0
|
||||
|
||||
544 50 38 1 1 0
|
||||
|
||||
576 106 64 0 0 0
|
||||
592 106 66 0 0 0
|
||||
|
||||
522 156 43 2 0 0
|
||||
538 156 44 2 0 0
|
||||
|
||||
448 196 25 2 0 0
|
||||
464 196 25 2 0 0
|
||||
480 196 25 2 0 0
|
||||
|
||||
400 156 43 2 0 0
|
||||
416 156 44 2 0 0
|
||||
|
||||
452 108 43 2 0 0
|
||||
468 108 44 2 0 0
|
||||
|
||||
192 228 25 130 0 0
|
||||
208 228 26 4 64 36
|
||||
224 228 25 2 0 0
|
||||
240 228 26 4 40 28
|
||||
|
||||
304 140 27 2 0 0
|
||||
320 140 26 4 64 36
|
||||
336 140 27 2 0 0
|
||||
|
||||
0 268 69 0 0 0
|
||||
16 268 70 0 0 0
|
||||
32 268 71 0 0 0
|
||||
|
||||
176 268 69 0 0 0
|
||||
192 268 71 0 0 0
|
||||
|
||||
432 268 69 0 0 0
|
||||
448 268 70 0 0 0
|
||||
464 268 71 0 0 0
|
||||
|
||||
64 228 26 4 64 36
|
||||
80 228 25 2 0 0
|
||||
96 228 25 2 0 0
|
||||
|
||||
512 268 54 2 0 0
|
||||
528 268 55 2 0 0
|
||||
512 252 46 2 0 0
|
||||
528 252 47 2 0 0
|
||||
|
||||
400 228 26 4 40 28
|
||||
|
||||
464 268 38 1 -1 0
|
||||
|
||||
512 268 54 2 0 0
|
||||
528 268 55 2 0 0
|
||||
512 252 46 2 0 0
|
||||
528 252 47 2 0 0
|
||||
|
||||
640 16 64 0 0 0
|
||||
656 16 65 0 0 0
|
||||
672 16 66 0 0 0
|
||||
|
||||
672 106 50 2 0 0
|
||||
688 106 51 2 0 0
|
||||
704 106 52 2 0 0
|
||||
720 106 50 2 0 0
|
||||
736 106 51 2 0 0
|
||||
752 106 52 2 0 0
|
||||
768 106 50 2 0 0
|
||||
784 106 50 2 0 0
|
||||
|
||||
778 90 38 1 -1 0
|
||||
680 90 38 1 1 0
|
||||
|
||||
720 50 26 4 64 36
|
||||
736 50 27 2 0 0
|
||||
752 50 26 4 64 36
|
||||
|
||||
704 268 25 0 0 0
|
||||
720 268 25 0 0 0
|
||||
736 268 68 0 0 0
|
||||
736 268 68 16 0 0
|
||||
752 268 25 0 0 0
|
||||
768 268 25 0 0 0
|
||||
704 252 25 0 0 0
|
||||
720 252 25 0 0 0
|
||||
736 252 67 0 0 0
|
||||
752 252 25 0 0 0
|
||||
768 252 25 0 0 0
|
||||
704 236 45 0 0 0
|
||||
720 236 45 0 0 0
|
||||
736 236 45 0 0 0
|
||||
752 236 45 0 0 0
|
||||
768 236 45 0 0 0
|
||||
700 220 56 0 0 0
|
||||
720 220 56 0 0 0
|
||||
736 220 56 0 0 0
|
||||
752 220 56 0 0 0
|
||||
771 220 56 0 0 0
|
||||
|
||||
16 268 0 0 0 0
|
||||
|
||||
-1 -1 -1 -1 -1 -1
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,72 @@
|
||||
#include /*!!TAB=4!*/<stdio.h>
|
||||
#include /*{{IOCCC2}}*/<SDL.h>
|
||||
#define b/*{{IOCCC257}}*/ if (
|
||||
#define a(b, c) for (b = 0 ; /*IOCCC/2014*/b<d; b++,c)
|
||||
e,h,f,g,i,j,k,l,m,n,o,p=1,*q,r,s=5, t,*u,x,y,z,A,B, C[
|
||||
333*7],d=333; D,E,F,G [2 ],H, I, J, K, L, M,N= 1,O,P,Q
|
||||
,*R;char * S, **T; /*33*/ ;
|
||||
SDL_Surface*U,* V; int*W( X
|
||||
){ u=C+X *7; b*u){ u++; x =u[0]; y=u[1
|
||||
]; H=u [2]; z =(H%8) *
|
||||
i; A=( H/8)*i ; B=u[ 3
|
||||
]/**/; return u; ; } return
|
||||
0; } Y (){ O=50; r= 0; t=1 ;
|
||||
} Z (X ,m, n,o)/**/ { /**/ ;
|
||||
return W(X)&&B&&(m< x+i&&n <
|
||||
y+i&&x<m+i&& y<n+o); } int*ba(int*u){ int X
|
||||
,*bb=C; a(X, bb+=7){ b!*bb){ *bb=1; R
|
||||
=bb +1; H=6; while(H--)*R++=*u++; /*W
|
||||
N N
|
||||
E E
|
||||
S S
|
||||
*/return bb; } } return 0; } bc(e){ q[2]=e; } bd
|
||||
(be,bf){ int X,bg; m+=be; n+=bf; I=e
|
||||
-i; m=m<0?0:(m>I?I:m); a(X,0){ b Z(X
|
||||
,m,n,o)){ bg=B&1; b D&&bg) continue;
|
||||
m-=be; n-=bf; b B&8){ u[-1]=0; j=1; bc(8); b B&32){ n-= i;
|
||||
o=i*2; } } b B&16&&!O){ bc(32+(o>i?8:0)); Y(); u[- 1]=0; }
|
||||
b(B&128&&bf&&s<0)||(B&64))u[-1]=0; b bg&&!O){ b bf&&s >0){
|
||||
u[2]--; u[3]=bf=0; s=-6; } else { b j){ bc(0); b o>i) n+=o=i; D=30; j=0;
|
||||
} else { bc(24); Y(); L=-1; } } } b B&4){ b bf&&s<0){ int I[]={ x,y-i,u[
|
||||
5],u[4],rand()%2?1:-1,2} ; u[2]++; u[3]=2; ba(I); } } b bf)s=1; break; }
|
||||
} } bh (m,e,k, bi){ H=k/ 2; G[bi]=m>e-H? k
|
||||
- e:(m>H?H-m:0 ); } bj(X,be ,bf){ int bk ;
|
||||
u [0]+=be; u[1 ]+=bf; W(X); E=x,F=y,I=0; a
|
||||
( bk,0){ b I=(X!=bk&&Z(bk,E,F,i)&&(B&6 )
|
||||
) )break; } W(X); b I){ b bf)u[1]-=bf; b
|
||||
be ){ u[0]-=be; u[4]*=-1*be; } } W( X); }
|
||||
bl (){ int bm=n,X; SDL_FillRect(U,0,M); X=4; while( X
|
||||
-- )bd(r,0); X=3; while(X--)bd(0,s); b n>h&&!O)Y () ;
|
||||
t =bm==n; q[0]=m; q[1]=n; bh(m,e,k,0); bh(n,h,l,1) ;
|
||||
a(X,0){ b W(X)){ b B&9){ bj(X,u[4],0); bj(X,0,2); } b B&1){ *u +=u[4]; b
|
||||
++u[5]>20){ u[4]*= -1; u[5]=0; } z+=K
|
||||
%2?i:0; } J=i; b q ==u){ J=o; b!O){ b
|
||||
r)z+=i*(K%2); b!t) z=48; z+=p<0?i*4:0
|
||||
; }} b q!=u||!(D&& 0==D%3)){ SDL_Rect
|
||||
bn={ z,A,i,J} ,bo= { G[0]+x,G[1]+y,i,
|
||||
J}; SDL_BlitSurface (V,&bn,U,&bo); } }
|
||||
} b(s+=2)>2)s=2; K ++; D-=D?1:0; b O)
|
||||
b!-- O) exit(L); } bp(X){ return strtol
|
||||
(T[X],0,0); } bq(int H , int*br,int bs ){ int bt;
|
||||
bt=Q-P; b bt>bs) bt= bs; SDL_MixAudio(br,S +P,bt,
|
||||
128); P+=bt; b P>=Q)P=0; } SDL_AudioSpec bu={8000
|
||||
,8,1,0,256,0,0,bq} ,bv ; main(int bw,char**bx){ T
|
||||
|
||||
|
||||
=bx; int by,H=255, bz=H<<8 ,bA =bz <<8,bB= bA<<8,
|
||||
bC=bp(5),bD=bp(6); SDL_Event bE; o =i= bC / 8; k = bp(1)
|
||||
,l=bp(2),e=bp(3),h =bp (4); M= bp(9); /**/ SDL_Init(/*<2053"*/
|
||||
0xffff ); b!*(char*) &N){ H=bB; bz =bA; bA =bz>>8;
|
||||
bB=255 ; } U=SDL_SetVideoMode(k,l,0,0); V=/*NES HISTORY
|
||||
SANDRO */ SDL_CreateRGBSurface(1 <<15 , bC, bD, 32,H,bz
|
||||
,bA,bB); fread(V-> pixels,bC*bD*4,1,fopen(T [7],"r" )); SDL_OpenAudio(&
|
||||
bu,0); SDL_LoadWAV (T[8],& bv,&S,&Q ); /**/ SDL_PauseAudio(0);
|
||||
for(; ; ){ int u[6 ],*I; H =0 ; while (H < 6) scanf(/*0*/
|
||||
"%d ", u+H++); b u[5]< 0)break ; I=ba(
|
||||
u);b!u [3]){ q =I+1; m =u[0 ]; n=u[1];
|
||||
} } for (; ; ){ while/* !MAFFIO DO.S*/(
|
||||
SDL_PollEvent(&bE) ) { by= bE.type ==3; b!O &&(by|| bE.
|
||||
type==2)){ I = bE. key/**/ .keysym .sym; b I== 276)r=
|
||||
by?0:(p=-1); b I== 275 )r= by?0:(p =1); b I==32)by?
|
||||
|
||||
0:(t?(s=-9):0); b I==27)exit(0); } } bl(); SDL_Flip(U); SDL_Delay(60); } }
|
||||
@@ -0,0 +1,72 @@
|
||||
#include /*!!TAB=4!*/<stdio.h>
|
||||
#include /*IOCCC2*/"SDL/SDL.h"
|
||||
#define b/*{{IOCCC257}}*/ if (
|
||||
#define a(b, c) for (b = 0 ; /*IOCCC/2014*/b<d; b++,c)
|
||||
e,h,f,g,i,j,k,l,m,n,o,p=1,*q,r,s=5, t,*u,x,y,z,A,B, C[
|
||||
333*7],d=333; D,E,F,G [2 ],H, I, J, K, L, M,N= 1,O,P,Q
|
||||
,*R;char * S, **T; /*33*/ ;
|
||||
SDL_Surface*U,* V; int*W( X
|
||||
){ u=C+X *7; b*u){ u++; x =u[0]; y=u[1
|
||||
]; H=u [2]; z =(H%8) *
|
||||
i; A=( H/8)*i ; B=u[ 3
|
||||
]/**/; return u; ; } return
|
||||
0; } Y (){ O=50; r= 0; t=1 ;
|
||||
} Z (X ,m, n,o)/**/ { /**/ ;
|
||||
return W(X)&&B&&(m< x+i&&n <
|
||||
y+i&&x<m+i&& y<n+o); } int*ba(int*u){ int X
|
||||
,*bb=C; a(X, bb+=7){ b!*bb){ *bb=1; R
|
||||
=bb +1; H=6; while(H--)*R++=*u++; /*W
|
||||
N N
|
||||
E E
|
||||
S S
|
||||
*/return bb; } } return 0; } bc(e){ q[2]=e; } bd
|
||||
(be,bf){ int X,bg; m+=be; n+=bf; I=e
|
||||
-i; m=m<0?0:(m>I?I:m); a(X,0){ b Z(X
|
||||
,m,n,o)){ bg=B&1; b D&&bg) continue;
|
||||
m-=be; n-=bf; b B&8){ u[-1]=0; j=1; bc(8); b B&32){ n-= i;
|
||||
o=i*2; } } b B&16&&!O){ bc(32+(o>i?8:0)); Y(); u[- 1]=0; }
|
||||
b(B&128&&bf&&s<0)||(B&64))u[-1]=0; b bg&&!O){ b bf&&s >0){
|
||||
u[2]--; u[3]=bf=0; s=-6; } else { b j){ bc(0); b o>i) n+=o=i; D=30; j=0;
|
||||
} else { bc(24); Y(); L=-1; } } } b B&4){ b bf&&s<0){ int I[]={ x,y-i,u[
|
||||
5],u[4],rand()%2?1:-1,2} ; u[2]++; u[3]=2; ba(I); } } b bf)s=1; break; }
|
||||
} } bh (m,e,k, bi){ H=k/ 2; G[bi]=m>e-H? k
|
||||
- e:(m>H?H-m:0 ); } bj(X,be ,bf){ int bk ;
|
||||
u [0]+=be; u[1 ]+=bf; W(X); E=x,F=y,I=0; a
|
||||
( bk,0){ b I=(X!=bk&&Z(bk,E,F,i)&&(B&6 )
|
||||
) )break; } W(X); b I){ b bf)u[1]-=bf; b
|
||||
be ){ u[0]-=be; u[4]*=-1*be; } } W( X); }
|
||||
bl (){ int bm=n,X; SDL_FillRect(U,0,M); X=4; while( X
|
||||
-- )bd(r,0); X=3; while(X--)bd(0,s); b n>h&&!O)Y () ;
|
||||
t =bm==n; q[0]=m; q[1]=n; bh(m,e,k,0); bh(n,h,l,1) ;
|
||||
a(X,0){ b W(X)){ b B&9){ bj(X,u[4],0); bj(X,0,2); } b B&1){ *u +=u[4]; b
|
||||
++u[5]>20){ u[4]*= -1; u[5]=0; } z+=K
|
||||
%2?i:0; } J=i; b q ==u){ J=o; b!O){ b
|
||||
r)z+=i*(K%2); b!t) z=48; z+=p<0?i*4:0
|
||||
; }} b q!=u||!(D&& 0==D%3)){ SDL_Rect
|
||||
bn={ z,A,i,J} ,bo= { G[0]+x,G[1]+y,i,
|
||||
J}; SDL_BlitSurface (V,&bn,U,&bo); } }
|
||||
} b(s+=2)>2)s=2; K ++; D-=D?1:0; b O)
|
||||
b!-- O) exit(L); } bp(X){ return strtol
|
||||
(T[X],0,0); } bq(int H , int*br,int bs ){ int bt;
|
||||
bt=Q-P; b bt>bs) bt= bs; SDL_MixAudio(br,S +P,bt,
|
||||
128); P+=bt; b P>=Q)P=0; } SDL_AudioSpec bu={8000
|
||||
,8,1,0,256,0,0,bq} ,bv ; main(int bw,char**bx){ T
|
||||
|
||||
|
||||
=bx; int by,H=255, bz=H<<8 ,bA =bz <<8,bB= bA<<8,
|
||||
bC=bp(5),bD=bp(6); SDL_Event bE; o =i= bC / 8; k = bp(1)
|
||||
,l=bp(2),e=bp(3),h =bp (4); M= bp(9); /**/ SDL_Init(/*<2053"*/
|
||||
0xffff ); b!*(char*) &N){ H=bB; bz =bA; bA =bz>>8;
|
||||
bB=255 ; } U=SDL_SetVideoMode(k,l,0,0); V=/*NES HISTORY
|
||||
SANDRO */ SDL_CreateRGBSurface(1 <<15 , bC, bD, 32,H,bz
|
||||
,bA,bB); fread(V-> pixels,bC*bD*4,1,fopen(T [7],"r" )); SDL_OpenAudio(&
|
||||
bu,0); SDL_LoadWAV (T[8],& bv,&S,&Q ); /**/ SDL_PauseAudio(0);
|
||||
for(; ; ){ int u[6 ],*I; H =0 ; while (H < 6) scanf(/*0*/
|
||||
"%d ", u+H++); b u[5]< 0)break ; I=ba(
|
||||
u);b!u [3]){ q =I+1; m =u[0 ]; n=u[1];
|
||||
} } for (; ; ){ while/* !MAFFIO DO.S*/(
|
||||
SDL_PollEvent(&bE) ) { by= bE.type ==3; b!O &&(by|| bE.
|
||||
type==2)){ I = bE. key/**/ .keysym .sym; b I== 276)r=
|
||||
by?0:(p=-1); b I== 275 )r= by?0:(p =1); b I==32)by?
|
||||
|
||||
0:(t?(s=-9):0); b I==27)exit(0); } } bl(); SDL_Flip(U); SDL_Delay(60); } }
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 9.5 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 10 KiB |
Reference in new issue
Block a user