Status: | Merged |
---|---|
Approved by: | Daniel Bell |
Approved revision: | 37 |
Merged at revision: | 20 |
Proposed branch: | lp:hopper |
Merge into: | lp:hopper/future |
Diff against target: |
3070 lines (+1730/-1233) 14 files modified
Frogger/CHANGES (+0/-19) Frogger/COPYING (+674/-0) Frogger/ChangeLog (+34/-0) Frogger/INSTALL (+5/-0) Frogger/LICENCE (+0/-674) Frogger/README (+63/-43) Frogger/data/frog-game.desktop (+10/-0) Frogger/data/icons/scalable/frog-game.svg (+68/-0) Frogger/frogger (+561/-0) Frogger/frogger.py (+0/-356) Frogger/lib/engine.py (+69/-0) Frogger/lib/sprites.py (+136/-0) Frogger/setup.py (+110/-0) Frogger/sprites.py (+0/-141) |
To merge this branch: | bzr merge lp:hopper |
Related bugs: |
Commit message
Updating from Legacy release 0.2.
Description of the change
This updates future to version 0.2 + a few other changes from upcoming 0.3 version.
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === removed file 'Frogger/CHANGES' | |||
2 | --- Frogger/CHANGES 2010-01-29 23:57:26 +0000 | |||
3 | +++ Frogger/CHANGES 1970-01-01 00:00:00 +0000 | |||
4 | @@ -1,19 +0,0 @@ | |||
5 | 1 | Frog Game (0.1) | ||
6 | 2 | |||
7 | 3 | * Moved Game to Python, instead of C#. | ||
8 | 4 | * Support for Linux and Mac OS X in addition to Windows. | ||
9 | 5 | * Fixed issues with CPU usage. | ||
10 | 6 | * Difficulty increases every level now instead of every 5: Still basic difficulty (speed increase only). | ||
11 | 7 | * Log size reduced to remove ability to slide from log to log on same level. | ||
12 | 8 | * Balancing on log removed. Currently a single pixel on log will be enough to prevent you from landing in water. (LP #514564) | ||
13 | 9 | * New Menu/Exit Screen. | ||
14 | 10 | * New Font: Blooming Grove released under Public Domain by Jonadab the Unsightly One (http://openfontlibrary.org/media/files/jonadab/414) | ||
15 | 11 | |||
16 | 12 | -- Daniel Bell <daniel.bell@saraclan.com> Fri, 29 Jan 2010. | ||
17 | 13 | |||
18 | 14 | Frog Game (prototype) | ||
19 | 15 | |||
20 | 16 | * Initial prototype to test the game concepts. | ||
21 | 17 | |||
22 | 18 | -- Daniel Bell <daniel.bell@saraclan.com> Sat, 12 Dec 2009. | ||
23 | 19 | |||
24 | 20 | 0 | ||
25 | === added file 'Frogger/COPYING' | |||
26 | --- Frogger/COPYING 1970-01-01 00:00:00 +0000 | |||
27 | +++ Frogger/COPYING 2010-03-12 10:44:17 +0000 | |||
28 | @@ -0,0 +1,674 @@ | |||
29 | 1 | GNU GENERAL PUBLIC LICENSE | ||
30 | 2 | Version 3, 29 June 2007 | ||
31 | 3 | |||
32 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> | ||
33 | 5 | Everyone is permitted to copy and distribute verbatim copies | ||
34 | 6 | of this license document, but changing it is not allowed. | ||
35 | 7 | |||
36 | 8 | Preamble | ||
37 | 9 | |||
38 | 10 | The GNU General Public License is a free, copyleft license for | ||
39 | 11 | software and other kinds of works. | ||
40 | 12 | |||
41 | 13 | The licenses for most software and other practical works are designed | ||
42 | 14 | to take away your freedom to share and change the works. By contrast, | ||
43 | 15 | the GNU General Public License is intended to guarantee your freedom to | ||
44 | 16 | share and change all versions of a program--to make sure it remains free | ||
45 | 17 | software for all its users. We, the Free Software Foundation, use the | ||
46 | 18 | GNU General Public License for most of our software; it applies also to | ||
47 | 19 | any other work released this way by its authors. You can apply it to | ||
48 | 20 | your programs, too. | ||
49 | 21 | |||
50 | 22 | When we speak of free software, we are referring to freedom, not | ||
51 | 23 | price. Our General Public Licenses are designed to make sure that you | ||
52 | 24 | have the freedom to distribute copies of free software (and charge for | ||
53 | 25 | them if you wish), that you receive source code or can get it if you | ||
54 | 26 | want it, that you can change the software or use pieces of it in new | ||
55 | 27 | free programs, and that you know you can do these things. | ||
56 | 28 | |||
57 | 29 | To protect your rights, we need to prevent others from denying you | ||
58 | 30 | these rights or asking you to surrender the rights. Therefore, you have | ||
59 | 31 | certain responsibilities if you distribute copies of the software, or if | ||
60 | 32 | you modify it: responsibilities to respect the freedom of others. | ||
61 | 33 | |||
62 | 34 | For example, if you distribute copies of such a program, whether | ||
63 | 35 | gratis or for a fee, you must pass on to the recipients the same | ||
64 | 36 | freedoms that you received. You must make sure that they, too, receive | ||
65 | 37 | or can get the source code. And you must show them these terms so they | ||
66 | 38 | know their rights. | ||
67 | 39 | |||
68 | 40 | Developers that use the GNU GPL protect your rights with two steps: | ||
69 | 41 | (1) assert copyright on the software, and (2) offer you this License | ||
70 | 42 | giving you legal permission to copy, distribute and/or modify it. | ||
71 | 43 | |||
72 | 44 | For the developers' and authors' protection, the GPL clearly explains | ||
73 | 45 | that there is no warranty for this free software. For both users' and | ||
74 | 46 | authors' sake, the GPL requires that modified versions be marked as | ||
75 | 47 | changed, so that their problems will not be attributed erroneously to | ||
76 | 48 | authors of previous versions. | ||
77 | 49 | |||
78 | 50 | Some devices are designed to deny users access to install or run | ||
79 | 51 | modified versions of the software inside them, although the manufacturer | ||
80 | 52 | can do so. This is fundamentally incompatible with the aim of | ||
81 | 53 | protecting users' freedom to change the software. The systematic | ||
82 | 54 | pattern of such abuse occurs in the area of products for individuals to | ||
83 | 55 | use, which is precisely where it is most unacceptable. Therefore, we | ||
84 | 56 | have designed this version of the GPL to prohibit the practice for those | ||
85 | 57 | products. If such problems arise substantially in other domains, we | ||
86 | 58 | stand ready to extend this provision to those domains in future versions | ||
87 | 59 | of the GPL, as needed to protect the freedom of users. | ||
88 | 60 | |||
89 | 61 | Finally, every program is threatened constantly by software patents. | ||
90 | 62 | States should not allow patents to restrict development and use of | ||
91 | 63 | software on general-purpose computers, but in those that do, we wish to | ||
92 | 64 | avoid the special danger that patents applied to a free program could | ||
93 | 65 | make it effectively proprietary. To prevent this, the GPL assures that | ||
94 | 66 | patents cannot be used to render the program non-free. | ||
95 | 67 | |||
96 | 68 | The precise terms and conditions for copying, distribution and | ||
97 | 69 | modification follow. | ||
98 | 70 | |||
99 | 71 | TERMS AND CONDITIONS | ||
100 | 72 | |||
101 | 73 | 0. Definitions. | ||
102 | 74 | |||
103 | 75 | "This License" refers to version 3 of the GNU General Public License. | ||
104 | 76 | |||
105 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of | ||
106 | 78 | works, such as semiconductor masks. | ||
107 | 79 | |||
108 | 80 | "The Program" refers to any copyrightable work licensed under this | ||
109 | 81 | License. Each licensee is addressed as "you". "Licensees" and | ||
110 | 82 | "recipients" may be individuals or organizations. | ||
111 | 83 | |||
112 | 84 | To "modify" a work means to copy from or adapt all or part of the work | ||
113 | 85 | in a fashion requiring copyright permission, other than the making of an | ||
114 | 86 | exact copy. The resulting work is called a "modified version" of the | ||
115 | 87 | earlier work or a work "based on" the earlier work. | ||
116 | 88 | |||
117 | 89 | A "covered work" means either the unmodified Program or a work based | ||
118 | 90 | on the Program. | ||
119 | 91 | |||
120 | 92 | To "propagate" a work means to do anything with it that, without | ||
121 | 93 | permission, would make you directly or secondarily liable for | ||
122 | 94 | infringement under applicable copyright law, except executing it on a | ||
123 | 95 | computer or modifying a private copy. Propagation includes copying, | ||
124 | 96 | distribution (with or without modification), making available to the | ||
125 | 97 | public, and in some countries other activities as well. | ||
126 | 98 | |||
127 | 99 | To "convey" a work means any kind of propagation that enables other | ||
128 | 100 | parties to make or receive copies. Mere interaction with a user through | ||
129 | 101 | a computer network, with no transfer of a copy, is not conveying. | ||
130 | 102 | |||
131 | 103 | An interactive user interface displays "Appropriate Legal Notices" | ||
132 | 104 | to the extent that it includes a convenient and prominently visible | ||
133 | 105 | feature that (1) displays an appropriate copyright notice, and (2) | ||
134 | 106 | tells the user that there is no warranty for the work (except to the | ||
135 | 107 | extent that warranties are provided), that licensees may convey the | ||
136 | 108 | work under this License, and how to view a copy of this License. If | ||
137 | 109 | the interface presents a list of user commands or options, such as a | ||
138 | 110 | menu, a prominent item in the list meets this criterion. | ||
139 | 111 | |||
140 | 112 | 1. Source Code. | ||
141 | 113 | |||
142 | 114 | The "source code" for a work means the preferred form of the work | ||
143 | 115 | for making modifications to it. "Object code" means any non-source | ||
144 | 116 | form of a work. | ||
145 | 117 | |||
146 | 118 | A "Standard Interface" means an interface that either is an official | ||
147 | 119 | standard defined by a recognized standards body, or, in the case of | ||
148 | 120 | interfaces specified for a particular programming language, one that | ||
149 | 121 | is widely used among developers working in that language. | ||
150 | 122 | |||
151 | 123 | The "System Libraries" of an executable work include anything, other | ||
152 | 124 | than the work as a whole, that (a) is included in the normal form of | ||
153 | 125 | packaging a Major Component, but which is not part of that Major | ||
154 | 126 | Component, and (b) serves only to enable use of the work with that | ||
155 | 127 | Major Component, or to implement a Standard Interface for which an | ||
156 | 128 | implementation is available to the public in source code form. A | ||
157 | 129 | "Major Component", in this context, means a major essential component | ||
158 | 130 | (kernel, window system, and so on) of the specific operating system | ||
159 | 131 | (if any) on which the executable work runs, or a compiler used to | ||
160 | 132 | produce the work, or an object code interpreter used to run it. | ||
161 | 133 | |||
162 | 134 | The "Corresponding Source" for a work in object code form means all | ||
163 | 135 | the source code needed to generate, install, and (for an executable | ||
164 | 136 | work) run the object code and to modify the work, including scripts to | ||
165 | 137 | control those activities. However, it does not include the work's | ||
166 | 138 | System Libraries, or general-purpose tools or generally available free | ||
167 | 139 | programs which are used unmodified in performing those activities but | ||
168 | 140 | which are not part of the work. For example, Corresponding Source | ||
169 | 141 | includes interface definition files associated with source files for | ||
170 | 142 | the work, and the source code for shared libraries and dynamically | ||
171 | 143 | linked subprograms that the work is specifically designed to require, | ||
172 | 144 | such as by intimate data communication or control flow between those | ||
173 | 145 | subprograms and other parts of the work. | ||
174 | 146 | |||
175 | 147 | The Corresponding Source need not include anything that users | ||
176 | 148 | can regenerate automatically from other parts of the Corresponding | ||
177 | 149 | Source. | ||
178 | 150 | |||
179 | 151 | The Corresponding Source for a work in source code form is that | ||
180 | 152 | same work. | ||
181 | 153 | |||
182 | 154 | 2. Basic Permissions. | ||
183 | 155 | |||
184 | 156 | All rights granted under this License are granted for the term of | ||
185 | 157 | copyright on the Program, and are irrevocable provided the stated | ||
186 | 158 | conditions are met. This License explicitly affirms your unlimited | ||
187 | 159 | permission to run the unmodified Program. The output from running a | ||
188 | 160 | covered work is covered by this License only if the output, given its | ||
189 | 161 | content, constitutes a covered work. This License acknowledges your | ||
190 | 162 | rights of fair use or other equivalent, as provided by copyright law. | ||
191 | 163 | |||
192 | 164 | You may make, run and propagate covered works that you do not | ||
193 | 165 | convey, without conditions so long as your license otherwise remains | ||
194 | 166 | in force. You may convey covered works to others for the sole purpose | ||
195 | 167 | of having them make modifications exclusively for you, or provide you | ||
196 | 168 | with facilities for running those works, provided that you comply with | ||
197 | 169 | the terms of this License in conveying all material for which you do | ||
198 | 170 | not control copyright. Those thus making or running the covered works | ||
199 | 171 | for you must do so exclusively on your behalf, under your direction | ||
200 | 172 | and control, on terms that prohibit them from making any copies of | ||
201 | 173 | your copyrighted material outside their relationship with you. | ||
202 | 174 | |||
203 | 175 | Conveying under any other circumstances is permitted solely under | ||
204 | 176 | the conditions stated below. Sublicensing is not allowed; section 10 | ||
205 | 177 | makes it unnecessary. | ||
206 | 178 | |||
207 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. | ||
208 | 180 | |||
209 | 181 | No covered work shall be deemed part of an effective technological | ||
210 | 182 | measure under any applicable law fulfilling obligations under article | ||
211 | 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or | ||
212 | 184 | similar laws prohibiting or restricting circumvention of such | ||
213 | 185 | measures. | ||
214 | 186 | |||
215 | 187 | When you convey a covered work, you waive any legal power to forbid | ||
216 | 188 | circumvention of technological measures to the extent such circumvention | ||
217 | 189 | is effected by exercising rights under this License with respect to | ||
218 | 190 | the covered work, and you disclaim any intention to limit operation or | ||
219 | 191 | modification of the work as a means of enforcing, against the work's | ||
220 | 192 | users, your or third parties' legal rights to forbid circumvention of | ||
221 | 193 | technological measures. | ||
222 | 194 | |||
223 | 195 | 4. Conveying Verbatim Copies. | ||
224 | 196 | |||
225 | 197 | You may convey verbatim copies of the Program's source code as you | ||
226 | 198 | receive it, in any medium, provided that you conspicuously and | ||
227 | 199 | appropriately publish on each copy an appropriate copyright notice; | ||
228 | 200 | keep intact all notices stating that this License and any | ||
229 | 201 | non-permissive terms added in accord with section 7 apply to the code; | ||
230 | 202 | keep intact all notices of the absence of any warranty; and give all | ||
231 | 203 | recipients a copy of this License along with the Program. | ||
232 | 204 | |||
233 | 205 | You may charge any price or no price for each copy that you convey, | ||
234 | 206 | and you may offer support or warranty protection for a fee. | ||
235 | 207 | |||
236 | 208 | 5. Conveying Modified Source Versions. | ||
237 | 209 | |||
238 | 210 | You may convey a work based on the Program, or the modifications to | ||
239 | 211 | produce it from the Program, in the form of source code under the | ||
240 | 212 | terms of section 4, provided that you also meet all of these conditions: | ||
241 | 213 | |||
242 | 214 | a) The work must carry prominent notices stating that you modified | ||
243 | 215 | it, and giving a relevant date. | ||
244 | 216 | |||
245 | 217 | b) The work must carry prominent notices stating that it is | ||
246 | 218 | released under this License and any conditions added under section | ||
247 | 219 | 7. This requirement modifies the requirement in section 4 to | ||
248 | 220 | "keep intact all notices". | ||
249 | 221 | |||
250 | 222 | c) You must license the entire work, as a whole, under this | ||
251 | 223 | License to anyone who comes into possession of a copy. This | ||
252 | 224 | License will therefore apply, along with any applicable section 7 | ||
253 | 225 | additional terms, to the whole of the work, and all its parts, | ||
254 | 226 | regardless of how they are packaged. This License gives no | ||
255 | 227 | permission to license the work in any other way, but it does not | ||
256 | 228 | invalidate such permission if you have separately received it. | ||
257 | 229 | |||
258 | 230 | d) If the work has interactive user interfaces, each must display | ||
259 | 231 | Appropriate Legal Notices; however, if the Program has interactive | ||
260 | 232 | interfaces that do not display Appropriate Legal Notices, your | ||
261 | 233 | work need not make them do so. | ||
262 | 234 | |||
263 | 235 | A compilation of a covered work with other separate and independent | ||
264 | 236 | works, which are not by their nature extensions of the covered work, | ||
265 | 237 | and which are not combined with it such as to form a larger program, | ||
266 | 238 | in or on a volume of a storage or distribution medium, is called an | ||
267 | 239 | "aggregate" if the compilation and its resulting copyright are not | ||
268 | 240 | used to limit the access or legal rights of the compilation's users | ||
269 | 241 | beyond what the individual works permit. Inclusion of a covered work | ||
270 | 242 | in an aggregate does not cause this License to apply to the other | ||
271 | 243 | parts of the aggregate. | ||
272 | 244 | |||
273 | 245 | 6. Conveying Non-Source Forms. | ||
274 | 246 | |||
275 | 247 | You may convey a covered work in object code form under the terms | ||
276 | 248 | of sections 4 and 5, provided that you also convey the | ||
277 | 249 | machine-readable Corresponding Source under the terms of this License, | ||
278 | 250 | in one of these ways: | ||
279 | 251 | |||
280 | 252 | a) Convey the object code in, or embodied in, a physical product | ||
281 | 253 | (including a physical distribution medium), accompanied by the | ||
282 | 254 | Corresponding Source fixed on a durable physical medium | ||
283 | 255 | customarily used for software interchange. | ||
284 | 256 | |||
285 | 257 | b) Convey the object code in, or embodied in, a physical product | ||
286 | 258 | (including a physical distribution medium), accompanied by a | ||
287 | 259 | written offer, valid for at least three years and valid for as | ||
288 | 260 | long as you offer spare parts or customer support for that product | ||
289 | 261 | model, to give anyone who possesses the object code either (1) a | ||
290 | 262 | copy of the Corresponding Source for all the software in the | ||
291 | 263 | product that is covered by this License, on a durable physical | ||
292 | 264 | medium customarily used for software interchange, for a price no | ||
293 | 265 | more than your reasonable cost of physically performing this | ||
294 | 266 | conveying of source, or (2) access to copy the | ||
295 | 267 | Corresponding Source from a network server at no charge. | ||
296 | 268 | |||
297 | 269 | c) Convey individual copies of the object code with a copy of the | ||
298 | 270 | written offer to provide the Corresponding Source. This | ||
299 | 271 | alternative is allowed only occasionally and noncommercially, and | ||
300 | 272 | only if you received the object code with such an offer, in accord | ||
301 | 273 | with subsection 6b. | ||
302 | 274 | |||
303 | 275 | d) Convey the object code by offering access from a designated | ||
304 | 276 | place (gratis or for a charge), and offer equivalent access to the | ||
305 | 277 | Corresponding Source in the same way through the same place at no | ||
306 | 278 | further charge. You need not require recipients to copy the | ||
307 | 279 | Corresponding Source along with the object code. If the place to | ||
308 | 280 | copy the object code is a network server, the Corresponding Source | ||
309 | 281 | may be on a different server (operated by you or a third party) | ||
310 | 282 | that supports equivalent copying facilities, provided you maintain | ||
311 | 283 | clear directions next to the object code saying where to find the | ||
312 | 284 | Corresponding Source. Regardless of what server hosts the | ||
313 | 285 | Corresponding Source, you remain obligated to ensure that it is | ||
314 | 286 | available for as long as needed to satisfy these requirements. | ||
315 | 287 | |||
316 | 288 | e) Convey the object code using peer-to-peer transmission, provided | ||
317 | 289 | you inform other peers where the object code and Corresponding | ||
318 | 290 | Source of the work are being offered to the general public at no | ||
319 | 291 | charge under subsection 6d. | ||
320 | 292 | |||
321 | 293 | A separable portion of the object code, whose source code is excluded | ||
322 | 294 | from the Corresponding Source as a System Library, need not be | ||
323 | 295 | included in conveying the object code work. | ||
324 | 296 | |||
325 | 297 | A "User Product" is either (1) a "consumer product", which means any | ||
326 | 298 | tangible personal property which is normally used for personal, family, | ||
327 | 299 | or household purposes, or (2) anything designed or sold for incorporation | ||
328 | 300 | into a dwelling. In determining whether a product is a consumer product, | ||
329 | 301 | doubtful cases shall be resolved in favor of coverage. For a particular | ||
330 | 302 | product received by a particular user, "normally used" refers to a | ||
331 | 303 | typical or common use of that class of product, regardless of the status | ||
332 | 304 | of the particular user or of the way in which the particular user | ||
333 | 305 | actually uses, or expects or is expected to use, the product. A product | ||
334 | 306 | is a consumer product regardless of whether the product has substantial | ||
335 | 307 | commercial, industrial or non-consumer uses, unless such uses represent | ||
336 | 308 | the only significant mode of use of the product. | ||
337 | 309 | |||
338 | 310 | "Installation Information" for a User Product means any methods, | ||
339 | 311 | procedures, authorization keys, or other information required to install | ||
340 | 312 | and execute modified versions of a covered work in that User Product from | ||
341 | 313 | a modified version of its Corresponding Source. The information must | ||
342 | 314 | suffice to ensure that the continued functioning of the modified object | ||
343 | 315 | code is in no case prevented or interfered with solely because | ||
344 | 316 | modification has been made. | ||
345 | 317 | |||
346 | 318 | If you convey an object code work under this section in, or with, or | ||
347 | 319 | specifically for use in, a User Product, and the conveying occurs as | ||
348 | 320 | part of a transaction in which the right of possession and use of the | ||
349 | 321 | User Product is transferred to the recipient in perpetuity or for a | ||
350 | 322 | fixed term (regardless of how the transaction is characterized), the | ||
351 | 323 | Corresponding Source conveyed under this section must be accompanied | ||
352 | 324 | by the Installation Information. But this requirement does not apply | ||
353 | 325 | if neither you nor any third party retains the ability to install | ||
354 | 326 | modified object code on the User Product (for example, the work has | ||
355 | 327 | been installed in ROM). | ||
356 | 328 | |||
357 | 329 | The requirement to provide Installation Information does not include a | ||
358 | 330 | requirement to continue to provide support service, warranty, or updates | ||
359 | 331 | for a work that has been modified or installed by the recipient, or for | ||
360 | 332 | the User Product in which it has been modified or installed. Access to a | ||
361 | 333 | network may be denied when the modification itself materially and | ||
362 | 334 | adversely affects the operation of the network or violates the rules and | ||
363 | 335 | protocols for communication across the network. | ||
364 | 336 | |||
365 | 337 | Corresponding Source conveyed, and Installation Information provided, | ||
366 | 338 | in accord with this section must be in a format that is publicly | ||
367 | 339 | documented (and with an implementation available to the public in | ||
368 | 340 | source code form), and must require no special password or key for | ||
369 | 341 | unpacking, reading or copying. | ||
370 | 342 | |||
371 | 343 | 7. Additional Terms. | ||
372 | 344 | |||
373 | 345 | "Additional permissions" are terms that supplement the terms of this | ||
374 | 346 | License by making exceptions from one or more of its conditions. | ||
375 | 347 | Additional permissions that are applicable to the entire Program shall | ||
376 | 348 | be treated as though they were included in this License, to the extent | ||
377 | 349 | that they are valid under applicable law. If additional permissions | ||
378 | 350 | apply only to part of the Program, that part may be used separately | ||
379 | 351 | under those permissions, but the entire Program remains governed by | ||
380 | 352 | this License without regard to the additional permissions. | ||
381 | 353 | |||
382 | 354 | When you convey a copy of a covered work, you may at your option | ||
383 | 355 | remove any additional permissions from that copy, or from any part of | ||
384 | 356 | it. (Additional permissions may be written to require their own | ||
385 | 357 | removal in certain cases when you modify the work.) You may place | ||
386 | 358 | additional permissions on material, added by you to a covered work, | ||
387 | 359 | for which you have or can give appropriate copyright permission. | ||
388 | 360 | |||
389 | 361 | Notwithstanding any other provision of this License, for material you | ||
390 | 362 | add to a covered work, you may (if authorized by the copyright holders of | ||
391 | 363 | that material) supplement the terms of this License with terms: | ||
392 | 364 | |||
393 | 365 | a) Disclaiming warranty or limiting liability differently from the | ||
394 | 366 | terms of sections 15 and 16 of this License; or | ||
395 | 367 | |||
396 | 368 | b) Requiring preservation of specified reasonable legal notices or | ||
397 | 369 | author attributions in that material or in the Appropriate Legal | ||
398 | 370 | Notices displayed by works containing it; or | ||
399 | 371 | |||
400 | 372 | c) Prohibiting misrepresentation of the origin of that material, or | ||
401 | 373 | requiring that modified versions of such material be marked in | ||
402 | 374 | reasonable ways as different from the original version; or | ||
403 | 375 | |||
404 | 376 | d) Limiting the use for publicity purposes of names of licensors or | ||
405 | 377 | authors of the material; or | ||
406 | 378 | |||
407 | 379 | e) Declining to grant rights under trademark law for use of some | ||
408 | 380 | trade names, trademarks, or service marks; or | ||
409 | 381 | |||
410 | 382 | f) Requiring indemnification of licensors and authors of that | ||
411 | 383 | material by anyone who conveys the material (or modified versions of | ||
412 | 384 | it) with contractual assumptions of liability to the recipient, for | ||
413 | 385 | any liability that these contractual assumptions directly impose on | ||
414 | 386 | those licensors and authors. | ||
415 | 387 | |||
416 | 388 | All other non-permissive additional terms are considered "further | ||
417 | 389 | restrictions" within the meaning of section 10. If the Program as you | ||
418 | 390 | received it, or any part of it, contains a notice stating that it is | ||
419 | 391 | governed by this License along with a term that is a further | ||
420 | 392 | restriction, you may remove that term. If a license document contains | ||
421 | 393 | a further restriction but permits relicensing or conveying under this | ||
422 | 394 | License, you may add to a covered work material governed by the terms | ||
423 | 395 | of that license document, provided that the further restriction does | ||
424 | 396 | not survive such relicensing or conveying. | ||
425 | 397 | |||
426 | 398 | If you add terms to a covered work in accord with this section, you | ||
427 | 399 | must place, in the relevant source files, a statement of the | ||
428 | 400 | additional terms that apply to those files, or a notice indicating | ||
429 | 401 | where to find the applicable terms. | ||
430 | 402 | |||
431 | 403 | Additional terms, permissive or non-permissive, may be stated in the | ||
432 | 404 | form of a separately written license, or stated as exceptions; | ||
433 | 405 | the above requirements apply either way. | ||
434 | 406 | |||
435 | 407 | 8. Termination. | ||
436 | 408 | |||
437 | 409 | You may not propagate or modify a covered work except as expressly | ||
438 | 410 | provided under this License. Any attempt otherwise to propagate or | ||
439 | 411 | modify it is void, and will automatically terminate your rights under | ||
440 | 412 | this License (including any patent licenses granted under the third | ||
441 | 413 | paragraph of section 11). | ||
442 | 414 | |||
443 | 415 | However, if you cease all violation of this License, then your | ||
444 | 416 | license from a particular copyright holder is reinstated (a) | ||
445 | 417 | provisionally, unless and until the copyright holder explicitly and | ||
446 | 418 | finally terminates your license, and (b) permanently, if the copyright | ||
447 | 419 | holder fails to notify you of the violation by some reasonable means | ||
448 | 420 | prior to 60 days after the cessation. | ||
449 | 421 | |||
450 | 422 | Moreover, your license from a particular copyright holder is | ||
451 | 423 | reinstated permanently if the copyright holder notifies you of the | ||
452 | 424 | violation by some reasonable means, this is the first time you have | ||
453 | 425 | received notice of violation of this License (for any work) from that | ||
454 | 426 | copyright holder, and you cure the violation prior to 30 days after | ||
455 | 427 | your receipt of the notice. | ||
456 | 428 | |||
457 | 429 | Termination of your rights under this section does not terminate the | ||
458 | 430 | licenses of parties who have received copies or rights from you under | ||
459 | 431 | this License. If your rights have been terminated and not permanently | ||
460 | 432 | reinstated, you do not qualify to receive new licenses for the same | ||
461 | 433 | material under section 10. | ||
462 | 434 | |||
463 | 435 | 9. Acceptance Not Required for Having Copies. | ||
464 | 436 | |||
465 | 437 | You are not required to accept this License in order to receive or | ||
466 | 438 | run a copy of the Program. Ancillary propagation of a covered work | ||
467 | 439 | occurring solely as a consequence of using peer-to-peer transmission | ||
468 | 440 | to receive a copy likewise does not require acceptance. However, | ||
469 | 441 | nothing other than this License grants you permission to propagate or | ||
470 | 442 | modify any covered work. These actions infringe copyright if you do | ||
471 | 443 | not accept this License. Therefore, by modifying or propagating a | ||
472 | 444 | covered work, you indicate your acceptance of this License to do so. | ||
473 | 445 | |||
474 | 446 | 10. Automatic Licensing of Downstream Recipients. | ||
475 | 447 | |||
476 | 448 | Each time you convey a covered work, the recipient automatically | ||
477 | 449 | receives a license from the original licensors, to run, modify and | ||
478 | 450 | propagate that work, subject to this License. You are not responsible | ||
479 | 451 | for enforcing compliance by third parties with this License. | ||
480 | 452 | |||
481 | 453 | An "entity transaction" is a transaction transferring control of an | ||
482 | 454 | organization, or substantially all assets of one, or subdividing an | ||
483 | 455 | organization, or merging organizations. If propagation of a covered | ||
484 | 456 | work results from an entity transaction, each party to that | ||
485 | 457 | transaction who receives a copy of the work also receives whatever | ||
486 | 458 | licenses to the work the party's predecessor in interest had or could | ||
487 | 459 | give under the previous paragraph, plus a right to possession of the | ||
488 | 460 | Corresponding Source of the work from the predecessor in interest, if | ||
489 | 461 | the predecessor has it or can get it with reasonable efforts. | ||
490 | 462 | |||
491 | 463 | You may not impose any further restrictions on the exercise of the | ||
492 | 464 | rights granted or affirmed under this License. For example, you may | ||
493 | 465 | not impose a license fee, royalty, or other charge for exercise of | ||
494 | 466 | rights granted under this License, and you may not initiate litigation | ||
495 | 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that | ||
496 | 468 | any patent claim is infringed by making, using, selling, offering for | ||
497 | 469 | sale, or importing the Program or any portion of it. | ||
498 | 470 | |||
499 | 471 | 11. Patents. | ||
500 | 472 | |||
501 | 473 | A "contributor" is a copyright holder who authorizes use under this | ||
502 | 474 | License of the Program or a work on which the Program is based. The | ||
503 | 475 | work thus licensed is called the contributor's "contributor version". | ||
504 | 476 | |||
505 | 477 | A contributor's "essential patent claims" are all patent claims | ||
506 | 478 | owned or controlled by the contributor, whether already acquired or | ||
507 | 479 | hereafter acquired, that would be infringed by some manner, permitted | ||
508 | 480 | by this License, of making, using, or selling its contributor version, | ||
509 | 481 | but do not include claims that would be infringed only as a | ||
510 | 482 | consequence of further modification of the contributor version. For | ||
511 | 483 | purposes of this definition, "control" includes the right to grant | ||
512 | 484 | patent sublicenses in a manner consistent with the requirements of | ||
513 | 485 | this License. | ||
514 | 486 | |||
515 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free | ||
516 | 488 | patent license under the contributor's essential patent claims, to | ||
517 | 489 | make, use, sell, offer for sale, import and otherwise run, modify and | ||
518 | 490 | propagate the contents of its contributor version. | ||
519 | 491 | |||
520 | 492 | In the following three paragraphs, a "patent license" is any express | ||
521 | 493 | agreement or commitment, however denominated, not to enforce a patent | ||
522 | 494 | (such as an express permission to practice a patent or covenant not to | ||
523 | 495 | sue for patent infringement). To "grant" such a patent license to a | ||
524 | 496 | party means to make such an agreement or commitment not to enforce a | ||
525 | 497 | patent against the party. | ||
526 | 498 | |||
527 | 499 | If you convey a covered work, knowingly relying on a patent license, | ||
528 | 500 | and the Corresponding Source of the work is not available for anyone | ||
529 | 501 | to copy, free of charge and under the terms of this License, through a | ||
530 | 502 | publicly available network server or other readily accessible means, | ||
531 | 503 | then you must either (1) cause the Corresponding Source to be so | ||
532 | 504 | available, or (2) arrange to deprive yourself of the benefit of the | ||
533 | 505 | patent license for this particular work, or (3) arrange, in a manner | ||
534 | 506 | consistent with the requirements of this License, to extend the patent | ||
535 | 507 | license to downstream recipients. "Knowingly relying" means you have | ||
536 | 508 | actual knowledge that, but for the patent license, your conveying the | ||
537 | 509 | covered work in a country, or your recipient's use of the covered work | ||
538 | 510 | in a country, would infringe one or more identifiable patents in that | ||
539 | 511 | country that you have reason to believe are valid. | ||
540 | 512 | |||
541 | 513 | If, pursuant to or in connection with a single transaction or | ||
542 | 514 | arrangement, you convey, or propagate by procuring conveyance of, a | ||
543 | 515 | covered work, and grant a patent license to some of the parties | ||
544 | 516 | receiving the covered work authorizing them to use, propagate, modify | ||
545 | 517 | or convey a specific copy of the covered work, then the patent license | ||
546 | 518 | you grant is automatically extended to all recipients of the covered | ||
547 | 519 | work and works based on it. | ||
548 | 520 | |||
549 | 521 | A patent license is "discriminatory" if it does not include within | ||
550 | 522 | the scope of its coverage, prohibits the exercise of, or is | ||
551 | 523 | conditioned on the non-exercise of one or more of the rights that are | ||
552 | 524 | specifically granted under this License. You may not convey a covered | ||
553 | 525 | work if you are a party to an arrangement with a third party that is | ||
554 | 526 | in the business of distributing software, under which you make payment | ||
555 | 527 | to the third party based on the extent of your activity of conveying | ||
556 | 528 | the work, and under which the third party grants, to any of the | ||
557 | 529 | parties who would receive the covered work from you, a discriminatory | ||
558 | 530 | patent license (a) in connection with copies of the covered work | ||
559 | 531 | conveyed by you (or copies made from those copies), or (b) primarily | ||
560 | 532 | for and in connection with specific products or compilations that | ||
561 | 533 | contain the covered work, unless you entered into that arrangement, | ||
562 | 534 | or that patent license was granted, prior to 28 March 2007. | ||
563 | 535 | |||
564 | 536 | Nothing in this License shall be construed as excluding or limiting | ||
565 | 537 | any implied license or other defenses to infringement that may | ||
566 | 538 | otherwise be available to you under applicable patent law. | ||
567 | 539 | |||
568 | 540 | 12. No Surrender of Others' Freedom. | ||
569 | 541 | |||
570 | 542 | If conditions are imposed on you (whether by court order, agreement or | ||
571 | 543 | otherwise) that contradict the conditions of this License, they do not | ||
572 | 544 | excuse you from the conditions of this License. If you cannot convey a | ||
573 | 545 | covered work so as to satisfy simultaneously your obligations under this | ||
574 | 546 | License and any other pertinent obligations, then as a consequence you may | ||
575 | 547 | not convey it at all. For example, if you agree to terms that obligate you | ||
576 | 548 | to collect a royalty for further conveying from those to whom you convey | ||
577 | 549 | the Program, the only way you could satisfy both those terms and this | ||
578 | 550 | License would be to refrain entirely from conveying the Program. | ||
579 | 551 | |||
580 | 552 | 13. Use with the GNU Affero General Public License. | ||
581 | 553 | |||
582 | 554 | Notwithstanding any other provision of this License, you have | ||
583 | 555 | permission to link or combine any covered work with a work licensed | ||
584 | 556 | under version 3 of the GNU Affero General Public License into a single | ||
585 | 557 | combined work, and to convey the resulting work. The terms of this | ||
586 | 558 | License will continue to apply to the part which is the covered work, | ||
587 | 559 | but the special requirements of the GNU Affero General Public License, | ||
588 | 560 | section 13, concerning interaction through a network will apply to the | ||
589 | 561 | combination as such. | ||
590 | 562 | |||
591 | 563 | 14. Revised Versions of this License. | ||
592 | 564 | |||
593 | 565 | The Free Software Foundation may publish revised and/or new versions of | ||
594 | 566 | the GNU General Public License from time to time. Such new versions will | ||
595 | 567 | be similar in spirit to the present version, but may differ in detail to | ||
596 | 568 | address new problems or concerns. | ||
597 | 569 | |||
598 | 570 | Each version is given a distinguishing version number. If the | ||
599 | 571 | Program specifies that a certain numbered version of the GNU General | ||
600 | 572 | Public License "or any later version" applies to it, you have the | ||
601 | 573 | option of following the terms and conditions either of that numbered | ||
602 | 574 | version or of any later version published by the Free Software | ||
603 | 575 | Foundation. If the Program does not specify a version number of the | ||
604 | 576 | GNU General Public License, you may choose any version ever published | ||
605 | 577 | by the Free Software Foundation. | ||
606 | 578 | |||
607 | 579 | If the Program specifies that a proxy can decide which future | ||
608 | 580 | versions of the GNU General Public License can be used, that proxy's | ||
609 | 581 | public statement of acceptance of a version permanently authorizes you | ||
610 | 582 | to choose that version for the Program. | ||
611 | 583 | |||
612 | 584 | Later license versions may give you additional or different | ||
613 | 585 | permissions. However, no additional obligations are imposed on any | ||
614 | 586 | author or copyright holder as a result of your choosing to follow a | ||
615 | 587 | later version. | ||
616 | 588 | |||
617 | 589 | 15. Disclaimer of Warranty. | ||
618 | 590 | |||
619 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY | ||
620 | 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT | ||
621 | 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY | ||
622 | 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, | ||
623 | 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
624 | 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM | ||
625 | 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF | ||
626 | 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. | ||
627 | 599 | |||
628 | 600 | 16. Limitation of Liability. | ||
629 | 601 | |||
630 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING | ||
631 | 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS | ||
632 | 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY | ||
633 | 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE | ||
634 | 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF | ||
635 | 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD | ||
636 | 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), | ||
637 | 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF | ||
638 | 610 | SUCH DAMAGES. | ||
639 | 611 | |||
640 | 612 | 17. Interpretation of Sections 15 and 16. | ||
641 | 613 | |||
642 | 614 | If the disclaimer of warranty and limitation of liability provided | ||
643 | 615 | above cannot be given local legal effect according to their terms, | ||
644 | 616 | reviewing courts shall apply local law that most closely approximates | ||
645 | 617 | an absolute waiver of all civil liability in connection with the | ||
646 | 618 | Program, unless a warranty or assumption of liability accompanies a | ||
647 | 619 | copy of the Program in return for a fee. | ||
648 | 620 | |||
649 | 621 | END OF TERMS AND CONDITIONS | ||
650 | 622 | |||
651 | 623 | How to Apply These Terms to Your New Programs | ||
652 | 624 | |||
653 | 625 | If you develop a new program, and you want it to be of the greatest | ||
654 | 626 | possible use to the public, the best way to achieve this is to make it | ||
655 | 627 | free software which everyone can redistribute and change under these terms. | ||
656 | 628 | |||
657 | 629 | To do so, attach the following notices to the program. It is safest | ||
658 | 630 | to attach them to the start of each source file to most effectively | ||
659 | 631 | state the exclusion of warranty; and each file should have at least | ||
660 | 632 | the "copyright" line and a pointer to where the full notice is found. | ||
661 | 633 | |||
662 | 634 | <one line to give the program's name and a brief idea of what it does.> | ||
663 | 635 | Copyright (C) <year> <name of author> | ||
664 | 636 | |||
665 | 637 | This program is free software: you can redistribute it and/or modify | ||
666 | 638 | it under the terms of the GNU General Public License as published by | ||
667 | 639 | the Free Software Foundation, either version 3 of the License, or | ||
668 | 640 | (at your option) any later version. | ||
669 | 641 | |||
670 | 642 | This program is distributed in the hope that it will be useful, | ||
671 | 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
672 | 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
673 | 645 | GNU General Public License for more details. | ||
674 | 646 | |||
675 | 647 | You should have received a copy of the GNU General Public License | ||
676 | 648 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
677 | 649 | |||
678 | 650 | Also add information on how to contact you by electronic and paper mail. | ||
679 | 651 | |||
680 | 652 | If the program does terminal interaction, make it output a short | ||
681 | 653 | notice like this when it starts in an interactive mode: | ||
682 | 654 | |||
683 | 655 | <program> Copyright (C) <year> <name of author> | ||
684 | 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. | ||
685 | 657 | This is free software, and you are welcome to redistribute it | ||
686 | 658 | under certain conditions; type `show c' for details. | ||
687 | 659 | |||
688 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate | ||
689 | 661 | parts of the General Public License. Of course, your program's commands | ||
690 | 662 | might be different; for a GUI interface, you would use an "about box". | ||
691 | 663 | |||
692 | 664 | You should also get your employer (if you work as a programmer) or school, | ||
693 | 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. | ||
694 | 666 | For more information on this, and how to apply and follow the GNU GPL, see | ||
695 | 667 | <http://www.gnu.org/licenses/>. | ||
696 | 668 | |||
697 | 669 | The GNU General Public License does not permit incorporating your program | ||
698 | 670 | into proprietary programs. If your program is a subroutine library, you | ||
699 | 671 | may consider it more useful to permit linking proprietary applications with | ||
700 | 672 | the library. If this is what you want to do, use the GNU Lesser General | ||
701 | 673 | Public License instead of this License. But first, please read | ||
702 | 674 | <http://www.gnu.org/philosophy/why-not-lgpl.html>. | ||
703 | 0 | 675 | ||
704 | === added file 'Frogger/ChangeLog' | |||
705 | --- Frogger/ChangeLog 1970-01-01 00:00:00 +0000 | |||
706 | +++ Frogger/ChangeLog 2010-03-12 10:44:17 +0000 | |||
707 | @@ -0,0 +1,34 @@ | |||
708 | 1 | Frog Game 0.3: | ||
709 | 2 | * Renamed CHANGES to ChangeLog. | ||
710 | 3 | * Renamed LICENSE to COPYING. | ||
711 | 4 | * Added INSTALL file (to instruct on how to install on Linux). | ||
712 | 5 | * Removed setup-win.py and setup-mac.py and created a single setup.py file. | ||
713 | 6 | * Added Package 'lib' to handle shared logic. | ||
714 | 7 | * Added frog.game.desktop file. | ||
715 | 8 | * Changed color of "safe" spots on background.png | ||
716 | 9 | |||
717 | 10 | Frog Game 0.2: | ||
718 | 11 | * Changed the objectives of the game to make the game more original. | ||
719 | 12 | * Changed game resolution to 800x600 instead of 600x800. | ||
720 | 13 | * Removed DOUBLEBUF and colour depth flags from display. | ||
721 | 14 | * Some general clean up and optimization of Frog Game. | ||
722 | 15 | * Fixed issues with font rendering (LP: #514236) | ||
723 | 16 | * You can now hold to move the Frog. | ||
724 | 17 | |||
725 | 18 | Frog Game 0.1: | ||
726 | 19 | * Moved Game to Python, instead of C#. | ||
727 | 20 | * Support for Linux and Mac OS X in addition to Windows. | ||
728 | 21 | * Fixed issues with CPU usage. | ||
729 | 22 | * Difficulty increases every level now instead of every 5: | ||
730 | 23 | Still basic difficulty (speed increase only). | ||
731 | 24 | * Log size reduced to remove ability to slide from log to log on | ||
732 | 25 | same level. | ||
733 | 26 | * Balancing on log removed. Currently a single pixel on log will | ||
734 | 27 | be enough to prevent you from landing in water. (LP: #514564) | ||
735 | 28 | * New Menu/Exit Screen. | ||
736 | 29 | * New Font: Blooming Grove released under Public Domain by Jonadab | ||
737 | 30 | the Unsightly One (http://openfontlibrary.org/media/files/jonadab/414) | ||
738 | 31 | |||
739 | 32 | Frog Game prototype: | ||
740 | 33 | * Initial prototype to test the game concepts. | ||
741 | 34 | |||
742 | 0 | 35 | ||
743 | === added file 'Frogger/INSTALL' | |||
744 | --- Frogger/INSTALL 1970-01-01 00:00:00 +0000 | |||
745 | +++ Frogger/INSTALL 2010-03-12 10:44:17 +0000 | |||
746 | @@ -0,0 +1,5 @@ | |||
747 | 1 | install python pygame library ("python-pygame" on Debian/ubuntu) and run: | ||
748 | 2 | |||
749 | 3 | ./setup.py install | ||
750 | 4 | |||
751 | 5 | Note that this is not as complete as a package install at the moment - e.g. GNOME menu integration will not happen and there is no uninstall option. | ||
752 | 0 | 6 | ||
753 | === removed file 'Frogger/LICENCE' | |||
754 | --- Frogger/LICENCE 2010-01-29 23:57:26 +0000 | |||
755 | +++ Frogger/LICENCE 1970-01-01 00:00:00 +0000 | |||
756 | @@ -1,674 +0,0 @@ | |||
757 | 1 | GNU GENERAL PUBLIC LICENSE | ||
758 | 2 | Version 3, 29 June 2007 | ||
759 | 3 | |||
760 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> | ||
761 | 5 | Everyone is permitted to copy and distribute verbatim copies | ||
762 | 6 | of this license document, but changing it is not allowed. | ||
763 | 7 | |||
764 | 8 | Preamble | ||
765 | 9 | |||
766 | 10 | The GNU General Public License is a free, copyleft license for | ||
767 | 11 | software and other kinds of works. | ||
768 | 12 | |||
769 | 13 | The licenses for most software and other practical works are designed | ||
770 | 14 | to take away your freedom to share and change the works. By contrast, | ||
771 | 15 | the GNU General Public License is intended to guarantee your freedom to | ||
772 | 16 | share and change all versions of a program--to make sure it remains free | ||
773 | 17 | software for all its users. We, the Free Software Foundation, use the | ||
774 | 18 | GNU General Public License for most of our software; it applies also to | ||
775 | 19 | any other work released this way by its authors. You can apply it to | ||
776 | 20 | your programs, too. | ||
777 | 21 | |||
778 | 22 | When we speak of free software, we are referring to freedom, not | ||
779 | 23 | price. Our General Public Licenses are designed to make sure that you | ||
780 | 24 | have the freedom to distribute copies of free software (and charge for | ||
781 | 25 | them if you wish), that you receive source code or can get it if you | ||
782 | 26 | want it, that you can change the software or use pieces of it in new | ||
783 | 27 | free programs, and that you know you can do these things. | ||
784 | 28 | |||
785 | 29 | To protect your rights, we need to prevent others from denying you | ||
786 | 30 | these rights or asking you to surrender the rights. Therefore, you have | ||
787 | 31 | certain responsibilities if you distribute copies of the software, or if | ||
788 | 32 | you modify it: responsibilities to respect the freedom of others. | ||
789 | 33 | |||
790 | 34 | For example, if you distribute copies of such a program, whether | ||
791 | 35 | gratis or for a fee, you must pass on to the recipients the same | ||
792 | 36 | freedoms that you received. You must make sure that they, too, receive | ||
793 | 37 | or can get the source code. And you must show them these terms so they | ||
794 | 38 | know their rights. | ||
795 | 39 | |||
796 | 40 | Developers that use the GNU GPL protect your rights with two steps: | ||
797 | 41 | (1) assert copyright on the software, and (2) offer you this License | ||
798 | 42 | giving you legal permission to copy, distribute and/or modify it. | ||
799 | 43 | |||
800 | 44 | For the developers' and authors' protection, the GPL clearly explains | ||
801 | 45 | that there is no warranty for this free software. For both users' and | ||
802 | 46 | authors' sake, the GPL requires that modified versions be marked as | ||
803 | 47 | changed, so that their problems will not be attributed erroneously to | ||
804 | 48 | authors of previous versions. | ||
805 | 49 | |||
806 | 50 | Some devices are designed to deny users access to install or run | ||
807 | 51 | modified versions of the software inside them, although the manufacturer | ||
808 | 52 | can do so. This is fundamentally incompatible with the aim of | ||
809 | 53 | protecting users' freedom to change the software. The systematic | ||
810 | 54 | pattern of such abuse occurs in the area of products for individuals to | ||
811 | 55 | use, which is precisely where it is most unacceptable. Therefore, we | ||
812 | 56 | have designed this version of the GPL to prohibit the practice for those | ||
813 | 57 | products. If such problems arise substantially in other domains, we | ||
814 | 58 | stand ready to extend this provision to those domains in future versions | ||
815 | 59 | of the GPL, as needed to protect the freedom of users. | ||
816 | 60 | |||
817 | 61 | Finally, every program is threatened constantly by software patents. | ||
818 | 62 | States should not allow patents to restrict development and use of | ||
819 | 63 | software on general-purpose computers, but in those that do, we wish to | ||
820 | 64 | avoid the special danger that patents applied to a free program could | ||
821 | 65 | make it effectively proprietary. To prevent this, the GPL assures that | ||
822 | 66 | patents cannot be used to render the program non-free. | ||
823 | 67 | |||
824 | 68 | The precise terms and conditions for copying, distribution and | ||
825 | 69 | modification follow. | ||
826 | 70 | |||
827 | 71 | TERMS AND CONDITIONS | ||
828 | 72 | |||
829 | 73 | 0. Definitions. | ||
830 | 74 | |||
831 | 75 | "This License" refers to version 3 of the GNU General Public License. | ||
832 | 76 | |||
833 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of | ||
834 | 78 | works, such as semiconductor masks. | ||
835 | 79 | |||
836 | 80 | "The Program" refers to any copyrightable work licensed under this | ||
837 | 81 | License. Each licensee is addressed as "you". "Licensees" and | ||
838 | 82 | "recipients" may be individuals or organizations. | ||
839 | 83 | |||
840 | 84 | To "modify" a work means to copy from or adapt all or part of the work | ||
841 | 85 | in a fashion requiring copyright permission, other than the making of an | ||
842 | 86 | exact copy. The resulting work is called a "modified version" of the | ||
843 | 87 | earlier work or a work "based on" the earlier work. | ||
844 | 88 | |||
845 | 89 | A "covered work" means either the unmodified Program or a work based | ||
846 | 90 | on the Program. | ||
847 | 91 | |||
848 | 92 | To "propagate" a work means to do anything with it that, without | ||
849 | 93 | permission, would make you directly or secondarily liable for | ||
850 | 94 | infringement under applicable copyright law, except executing it on a | ||
851 | 95 | computer or modifying a private copy. Propagation includes copying, | ||
852 | 96 | distribution (with or without modification), making available to the | ||
853 | 97 | public, and in some countries other activities as well. | ||
854 | 98 | |||
855 | 99 | To "convey" a work means any kind of propagation that enables other | ||
856 | 100 | parties to make or receive copies. Mere interaction with a user through | ||
857 | 101 | a computer network, with no transfer of a copy, is not conveying. | ||
858 | 102 | |||
859 | 103 | An interactive user interface displays "Appropriate Legal Notices" | ||
860 | 104 | to the extent that it includes a convenient and prominently visible | ||
861 | 105 | feature that (1) displays an appropriate copyright notice, and (2) | ||
862 | 106 | tells the user that there is no warranty for the work (except to the | ||
863 | 107 | extent that warranties are provided), that licensees may convey the | ||
864 | 108 | work under this License, and how to view a copy of this License. If | ||
865 | 109 | the interface presents a list of user commands or options, such as a | ||
866 | 110 | menu, a prominent item in the list meets this criterion. | ||
867 | 111 | |||
868 | 112 | 1. Source Code. | ||
869 | 113 | |||
870 | 114 | The "source code" for a work means the preferred form of the work | ||
871 | 115 | for making modifications to it. "Object code" means any non-source | ||
872 | 116 | form of a work. | ||
873 | 117 | |||
874 | 118 | A "Standard Interface" means an interface that either is an official | ||
875 | 119 | standard defined by a recognized standards body, or, in the case of | ||
876 | 120 | interfaces specified for a particular programming language, one that | ||
877 | 121 | is widely used among developers working in that language. | ||
878 | 122 | |||
879 | 123 | The "System Libraries" of an executable work include anything, other | ||
880 | 124 | than the work as a whole, that (a) is included in the normal form of | ||
881 | 125 | packaging a Major Component, but which is not part of that Major | ||
882 | 126 | Component, and (b) serves only to enable use of the work with that | ||
883 | 127 | Major Component, or to implement a Standard Interface for which an | ||
884 | 128 | implementation is available to the public in source code form. A | ||
885 | 129 | "Major Component", in this context, means a major essential component | ||
886 | 130 | (kernel, window system, and so on) of the specific operating system | ||
887 | 131 | (if any) on which the executable work runs, or a compiler used to | ||
888 | 132 | produce the work, or an object code interpreter used to run it. | ||
889 | 133 | |||
890 | 134 | The "Corresponding Source" for a work in object code form means all | ||
891 | 135 | the source code needed to generate, install, and (for an executable | ||
892 | 136 | work) run the object code and to modify the work, including scripts to | ||
893 | 137 | control those activities. However, it does not include the work's | ||
894 | 138 | System Libraries, or general-purpose tools or generally available free | ||
895 | 139 | programs which are used unmodified in performing those activities but | ||
896 | 140 | which are not part of the work. For example, Corresponding Source | ||
897 | 141 | includes interface definition files associated with source files for | ||
898 | 142 | the work, and the source code for shared libraries and dynamically | ||
899 | 143 | linked subprograms that the work is specifically designed to require, | ||
900 | 144 | such as by intimate data communication or control flow between those | ||
901 | 145 | subprograms and other parts of the work. | ||
902 | 146 | |||
903 | 147 | The Corresponding Source need not include anything that users | ||
904 | 148 | can regenerate automatically from other parts of the Corresponding | ||
905 | 149 | Source. | ||
906 | 150 | |||
907 | 151 | The Corresponding Source for a work in source code form is that | ||
908 | 152 | same work. | ||
909 | 153 | |||
910 | 154 | 2. Basic Permissions. | ||
911 | 155 | |||
912 | 156 | All rights granted under this License are granted for the term of | ||
913 | 157 | copyright on the Program, and are irrevocable provided the stated | ||
914 | 158 | conditions are met. This License explicitly affirms your unlimited | ||
915 | 159 | permission to run the unmodified Program. The output from running a | ||
916 | 160 | covered work is covered by this License only if the output, given its | ||
917 | 161 | content, constitutes a covered work. This License acknowledges your | ||
918 | 162 | rights of fair use or other equivalent, as provided by copyright law. | ||
919 | 163 | |||
920 | 164 | You may make, run and propagate covered works that you do not | ||
921 | 165 | convey, without conditions so long as your license otherwise remains | ||
922 | 166 | in force. You may convey covered works to others for the sole purpose | ||
923 | 167 | of having them make modifications exclusively for you, or provide you | ||
924 | 168 | with facilities for running those works, provided that you comply with | ||
925 | 169 | the terms of this License in conveying all material for which you do | ||
926 | 170 | not control copyright. Those thus making or running the covered works | ||
927 | 171 | for you must do so exclusively on your behalf, under your direction | ||
928 | 172 | and control, on terms that prohibit them from making any copies of | ||
929 | 173 | your copyrighted material outside their relationship with you. | ||
930 | 174 | |||
931 | 175 | Conveying under any other circumstances is permitted solely under | ||
932 | 176 | the conditions stated below. Sublicensing is not allowed; section 10 | ||
933 | 177 | makes it unnecessary. | ||
934 | 178 | |||
935 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. | ||
936 | 180 | |||
937 | 181 | No covered work shall be deemed part of an effective technological | ||
938 | 182 | measure under any applicable law fulfilling obligations under article | ||
939 | 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or | ||
940 | 184 | similar laws prohibiting or restricting circumvention of such | ||
941 | 185 | measures. | ||
942 | 186 | |||
943 | 187 | When you convey a covered work, you waive any legal power to forbid | ||
944 | 188 | circumvention of technological measures to the extent such circumvention | ||
945 | 189 | is effected by exercising rights under this License with respect to | ||
946 | 190 | the covered work, and you disclaim any intention to limit operation or | ||
947 | 191 | modification of the work as a means of enforcing, against the work's | ||
948 | 192 | users, your or third parties' legal rights to forbid circumvention of | ||
949 | 193 | technological measures. | ||
950 | 194 | |||
951 | 195 | 4. Conveying Verbatim Copies. | ||
952 | 196 | |||
953 | 197 | You may convey verbatim copies of the Program's source code as you | ||
954 | 198 | receive it, in any medium, provided that you conspicuously and | ||
955 | 199 | appropriately publish on each copy an appropriate copyright notice; | ||
956 | 200 | keep intact all notices stating that this License and any | ||
957 | 201 | non-permissive terms added in accord with section 7 apply to the code; | ||
958 | 202 | keep intact all notices of the absence of any warranty; and give all | ||
959 | 203 | recipients a copy of this License along with the Program. | ||
960 | 204 | |||
961 | 205 | You may charge any price or no price for each copy that you convey, | ||
962 | 206 | and you may offer support or warranty protection for a fee. | ||
963 | 207 | |||
964 | 208 | 5. Conveying Modified Source Versions. | ||
965 | 209 | |||
966 | 210 | You may convey a work based on the Program, or the modifications to | ||
967 | 211 | produce it from the Program, in the form of source code under the | ||
968 | 212 | terms of section 4, provided that you also meet all of these conditions: | ||
969 | 213 | |||
970 | 214 | a) The work must carry prominent notices stating that you modified | ||
971 | 215 | it, and giving a relevant date. | ||
972 | 216 | |||
973 | 217 | b) The work must carry prominent notices stating that it is | ||
974 | 218 | released under this License and any conditions added under section | ||
975 | 219 | 7. This requirement modifies the requirement in section 4 to | ||
976 | 220 | "keep intact all notices". | ||
977 | 221 | |||
978 | 222 | c) You must license the entire work, as a whole, under this | ||
979 | 223 | License to anyone who comes into possession of a copy. This | ||
980 | 224 | License will therefore apply, along with any applicable section 7 | ||
981 | 225 | additional terms, to the whole of the work, and all its parts, | ||
982 | 226 | regardless of how they are packaged. This License gives no | ||
983 | 227 | permission to license the work in any other way, but it does not | ||
984 | 228 | invalidate such permission if you have separately received it. | ||
985 | 229 | |||
986 | 230 | d) If the work has interactive user interfaces, each must display | ||
987 | 231 | Appropriate Legal Notices; however, if the Program has interactive | ||
988 | 232 | interfaces that do not display Appropriate Legal Notices, your | ||
989 | 233 | work need not make them do so. | ||
990 | 234 | |||
991 | 235 | A compilation of a covered work with other separate and independent | ||
992 | 236 | works, which are not by their nature extensions of the covered work, | ||
993 | 237 | and which are not combined with it such as to form a larger program, | ||
994 | 238 | in or on a volume of a storage or distribution medium, is called an | ||
995 | 239 | "aggregate" if the compilation and its resulting copyright are not | ||
996 | 240 | used to limit the access or legal rights of the compilation's users | ||
997 | 241 | beyond what the individual works permit. Inclusion of a covered work | ||
998 | 242 | in an aggregate does not cause this License to apply to the other | ||
999 | 243 | parts of the aggregate. | ||
1000 | 244 | |||
1001 | 245 | 6. Conveying Non-Source Forms. | ||
1002 | 246 | |||
1003 | 247 | You may convey a covered work in object code form under the terms | ||
1004 | 248 | of sections 4 and 5, provided that you also convey the | ||
1005 | 249 | machine-readable Corresponding Source under the terms of this License, | ||
1006 | 250 | in one of these ways: | ||
1007 | 251 | |||
1008 | 252 | a) Convey the object code in, or embodied in, a physical product | ||
1009 | 253 | (including a physical distribution medium), accompanied by the | ||
1010 | 254 | Corresponding Source fixed on a durable physical medium | ||
1011 | 255 | customarily used for software interchange. | ||
1012 | 256 | |||
1013 | 257 | b) Convey the object code in, or embodied in, a physical product | ||
1014 | 258 | (including a physical distribution medium), accompanied by a | ||
1015 | 259 | written offer, valid for at least three years and valid for as | ||
1016 | 260 | long as you offer spare parts or customer support for that product | ||
1017 | 261 | model, to give anyone who possesses the object code either (1) a | ||
1018 | 262 | copy of the Corresponding Source for all the software in the | ||
1019 | 263 | product that is covered by this License, on a durable physical | ||
1020 | 264 | medium customarily used for software interchange, for a price no | ||
1021 | 265 | more than your reasonable cost of physically performing this | ||
1022 | 266 | conveying of source, or (2) access to copy the | ||
1023 | 267 | Corresponding Source from a network server at no charge. | ||
1024 | 268 | |||
1025 | 269 | c) Convey individual copies of the object code with a copy of the | ||
1026 | 270 | written offer to provide the Corresponding Source. This | ||
1027 | 271 | alternative is allowed only occasionally and noncommercially, and | ||
1028 | 272 | only if you received the object code with such an offer, in accord | ||
1029 | 273 | with subsection 6b. | ||
1030 | 274 | |||
1031 | 275 | d) Convey the object code by offering access from a designated | ||
1032 | 276 | place (gratis or for a charge), and offer equivalent access to the | ||
1033 | 277 | Corresponding Source in the same way through the same place at no | ||
1034 | 278 | further charge. You need not require recipients to copy the | ||
1035 | 279 | Corresponding Source along with the object code. If the place to | ||
1036 | 280 | copy the object code is a network server, the Corresponding Source | ||
1037 | 281 | may be on a different server (operated by you or a third party) | ||
1038 | 282 | that supports equivalent copying facilities, provided you maintain | ||
1039 | 283 | clear directions next to the object code saying where to find the | ||
1040 | 284 | Corresponding Source. Regardless of what server hosts the | ||
1041 | 285 | Corresponding Source, you remain obligated to ensure that it is | ||
1042 | 286 | available for as long as needed to satisfy these requirements. | ||
1043 | 287 | |||
1044 | 288 | e) Convey the object code using peer-to-peer transmission, provided | ||
1045 | 289 | you inform other peers where the object code and Corresponding | ||
1046 | 290 | Source of the work are being offered to the general public at no | ||
1047 | 291 | charge under subsection 6d. | ||
1048 | 292 | |||
1049 | 293 | A separable portion of the object code, whose source code is excluded | ||
1050 | 294 | from the Corresponding Source as a System Library, need not be | ||
1051 | 295 | included in conveying the object code work. | ||
1052 | 296 | |||
1053 | 297 | A "User Product" is either (1) a "consumer product", which means any | ||
1054 | 298 | tangible personal property which is normally used for personal, family, | ||
1055 | 299 | or household purposes, or (2) anything designed or sold for incorporation | ||
1056 | 300 | into a dwelling. In determining whether a product is a consumer product, | ||
1057 | 301 | doubtful cases shall be resolved in favor of coverage. For a particular | ||
1058 | 302 | product received by a particular user, "normally used" refers to a | ||
1059 | 303 | typical or common use of that class of product, regardless of the status | ||
1060 | 304 | of the particular user or of the way in which the particular user | ||
1061 | 305 | actually uses, or expects or is expected to use, the product. A product | ||
1062 | 306 | is a consumer product regardless of whether the product has substantial | ||
1063 | 307 | commercial, industrial or non-consumer uses, unless such uses represent | ||
1064 | 308 | the only significant mode of use of the product. | ||
1065 | 309 | |||
1066 | 310 | "Installation Information" for a User Product means any methods, | ||
1067 | 311 | procedures, authorization keys, or other information required to install | ||
1068 | 312 | and execute modified versions of a covered work in that User Product from | ||
1069 | 313 | a modified version of its Corresponding Source. The information must | ||
1070 | 314 | suffice to ensure that the continued functioning of the modified object | ||
1071 | 315 | code is in no case prevented or interfered with solely because | ||
1072 | 316 | modification has been made. | ||
1073 | 317 | |||
1074 | 318 | If you convey an object code work under this section in, or with, or | ||
1075 | 319 | specifically for use in, a User Product, and the conveying occurs as | ||
1076 | 320 | part of a transaction in which the right of possession and use of the | ||
1077 | 321 | User Product is transferred to the recipient in perpetuity or for a | ||
1078 | 322 | fixed term (regardless of how the transaction is characterized), the | ||
1079 | 323 | Corresponding Source conveyed under this section must be accompanied | ||
1080 | 324 | by the Installation Information. But this requirement does not apply | ||
1081 | 325 | if neither you nor any third party retains the ability to install | ||
1082 | 326 | modified object code on the User Product (for example, the work has | ||
1083 | 327 | been installed in ROM). | ||
1084 | 328 | |||
1085 | 329 | The requirement to provide Installation Information does not include a | ||
1086 | 330 | requirement to continue to provide support service, warranty, or updates | ||
1087 | 331 | for a work that has been modified or installed by the recipient, or for | ||
1088 | 332 | the User Product in which it has been modified or installed. Access to a | ||
1089 | 333 | network may be denied when the modification itself materially and | ||
1090 | 334 | adversely affects the operation of the network or violates the rules and | ||
1091 | 335 | protocols for communication across the network. | ||
1092 | 336 | |||
1093 | 337 | Corresponding Source conveyed, and Installation Information provided, | ||
1094 | 338 | in accord with this section must be in a format that is publicly | ||
1095 | 339 | documented (and with an implementation available to the public in | ||
1096 | 340 | source code form), and must require no special password or key for | ||
1097 | 341 | unpacking, reading or copying. | ||
1098 | 342 | |||
1099 | 343 | 7. Additional Terms. | ||
1100 | 344 | |||
1101 | 345 | "Additional permissions" are terms that supplement the terms of this | ||
1102 | 346 | License by making exceptions from one or more of its conditions. | ||
1103 | 347 | Additional permissions that are applicable to the entire Program shall | ||
1104 | 348 | be treated as though they were included in this License, to the extent | ||
1105 | 349 | that they are valid under applicable law. If additional permissions | ||
1106 | 350 | apply only to part of the Program, that part may be used separately | ||
1107 | 351 | under those permissions, but the entire Program remains governed by | ||
1108 | 352 | this License without regard to the additional permissions. | ||
1109 | 353 | |||
1110 | 354 | When you convey a copy of a covered work, you may at your option | ||
1111 | 355 | remove any additional permissions from that copy, or from any part of | ||
1112 | 356 | it. (Additional permissions may be written to require their own | ||
1113 | 357 | removal in certain cases when you modify the work.) You may place | ||
1114 | 358 | additional permissions on material, added by you to a covered work, | ||
1115 | 359 | for which you have or can give appropriate copyright permission. | ||
1116 | 360 | |||
1117 | 361 | Notwithstanding any other provision of this License, for material you | ||
1118 | 362 | add to a covered work, you may (if authorized by the copyright holders of | ||
1119 | 363 | that material) supplement the terms of this License with terms: | ||
1120 | 364 | |||
1121 | 365 | a) Disclaiming warranty or limiting liability differently from the | ||
1122 | 366 | terms of sections 15 and 16 of this License; or | ||
1123 | 367 | |||
1124 | 368 | b) Requiring preservation of specified reasonable legal notices or | ||
1125 | 369 | author attributions in that material or in the Appropriate Legal | ||
1126 | 370 | Notices displayed by works containing it; or | ||
1127 | 371 | |||
1128 | 372 | c) Prohibiting misrepresentation of the origin of that material, or | ||
1129 | 373 | requiring that modified versions of such material be marked in | ||
1130 | 374 | reasonable ways as different from the original version; or | ||
1131 | 375 | |||
1132 | 376 | d) Limiting the use for publicity purposes of names of licensors or | ||
1133 | 377 | authors of the material; or | ||
1134 | 378 | |||
1135 | 379 | e) Declining to grant rights under trademark law for use of some | ||
1136 | 380 | trade names, trademarks, or service marks; or | ||
1137 | 381 | |||
1138 | 382 | f) Requiring indemnification of licensors and authors of that | ||
1139 | 383 | material by anyone who conveys the material (or modified versions of | ||
1140 | 384 | it) with contractual assumptions of liability to the recipient, for | ||
1141 | 385 | any liability that these contractual assumptions directly impose on | ||
1142 | 386 | those licensors and authors. | ||
1143 | 387 | |||
1144 | 388 | All other non-permissive additional terms are considered "further | ||
1145 | 389 | restrictions" within the meaning of section 10. If the Program as you | ||
1146 | 390 | received it, or any part of it, contains a notice stating that it is | ||
1147 | 391 | governed by this License along with a term that is a further | ||
1148 | 392 | restriction, you may remove that term. If a license document contains | ||
1149 | 393 | a further restriction but permits relicensing or conveying under this | ||
1150 | 394 | License, you may add to a covered work material governed by the terms | ||
1151 | 395 | of that license document, provided that the further restriction does | ||
1152 | 396 | not survive such relicensing or conveying. | ||
1153 | 397 | |||
1154 | 398 | If you add terms to a covered work in accord with this section, you | ||
1155 | 399 | must place, in the relevant source files, a statement of the | ||
1156 | 400 | additional terms that apply to those files, or a notice indicating | ||
1157 | 401 | where to find the applicable terms. | ||
1158 | 402 | |||
1159 | 403 | Additional terms, permissive or non-permissive, may be stated in the | ||
1160 | 404 | form of a separately written license, or stated as exceptions; | ||
1161 | 405 | the above requirements apply either way. | ||
1162 | 406 | |||
1163 | 407 | 8. Termination. | ||
1164 | 408 | |||
1165 | 409 | You may not propagate or modify a covered work except as expressly | ||
1166 | 410 | provided under this License. Any attempt otherwise to propagate or | ||
1167 | 411 | modify it is void, and will automatically terminate your rights under | ||
1168 | 412 | this License (including any patent licenses granted under the third | ||
1169 | 413 | paragraph of section 11). | ||
1170 | 414 | |||
1171 | 415 | However, if you cease all violation of this License, then your | ||
1172 | 416 | license from a particular copyright holder is reinstated (a) | ||
1173 | 417 | provisionally, unless and until the copyright holder explicitly and | ||
1174 | 418 | finally terminates your license, and (b) permanently, if the copyright | ||
1175 | 419 | holder fails to notify you of the violation by some reasonable means | ||
1176 | 420 | prior to 60 days after the cessation. | ||
1177 | 421 | |||
1178 | 422 | Moreover, your license from a particular copyright holder is | ||
1179 | 423 | reinstated permanently if the copyright holder notifies you of the | ||
1180 | 424 | violation by some reasonable means, this is the first time you have | ||
1181 | 425 | received notice of violation of this License (for any work) from that | ||
1182 | 426 | copyright holder, and you cure the violation prior to 30 days after | ||
1183 | 427 | your receipt of the notice. | ||
1184 | 428 | |||
1185 | 429 | Termination of your rights under this section does not terminate the | ||
1186 | 430 | licenses of parties who have received copies or rights from you under | ||
1187 | 431 | this License. If your rights have been terminated and not permanently | ||
1188 | 432 | reinstated, you do not qualify to receive new licenses for the same | ||
1189 | 433 | material under section 10. | ||
1190 | 434 | |||
1191 | 435 | 9. Acceptance Not Required for Having Copies. | ||
1192 | 436 | |||
1193 | 437 | You are not required to accept this License in order to receive or | ||
1194 | 438 | run a copy of the Program. Ancillary propagation of a covered work | ||
1195 | 439 | occurring solely as a consequence of using peer-to-peer transmission | ||
1196 | 440 | to receive a copy likewise does not require acceptance. However, | ||
1197 | 441 | nothing other than this License grants you permission to propagate or | ||
1198 | 442 | modify any covered work. These actions infringe copyright if you do | ||
1199 | 443 | not accept this License. Therefore, by modifying or propagating a | ||
1200 | 444 | covered work, you indicate your acceptance of this License to do so. | ||
1201 | 445 | |||
1202 | 446 | 10. Automatic Licensing of Downstream Recipients. | ||
1203 | 447 | |||
1204 | 448 | Each time you convey a covered work, the recipient automatically | ||
1205 | 449 | receives a license from the original licensors, to run, modify and | ||
1206 | 450 | propagate that work, subject to this License. You are not responsible | ||
1207 | 451 | for enforcing compliance by third parties with this License. | ||
1208 | 452 | |||
1209 | 453 | An "entity transaction" is a transaction transferring control of an | ||
1210 | 454 | organization, or substantially all assets of one, or subdividing an | ||
1211 | 455 | organization, or merging organizations. If propagation of a covered | ||
1212 | 456 | work results from an entity transaction, each party to that | ||
1213 | 457 | transaction who receives a copy of the work also receives whatever | ||
1214 | 458 | licenses to the work the party's predecessor in interest had or could | ||
1215 | 459 | give under the previous paragraph, plus a right to possession of the | ||
1216 | 460 | Corresponding Source of the work from the predecessor in interest, if | ||
1217 | 461 | the predecessor has it or can get it with reasonable efforts. | ||
1218 | 462 | |||
1219 | 463 | You may not impose any further restrictions on the exercise of the | ||
1220 | 464 | rights granted or affirmed under this License. For example, you may | ||
1221 | 465 | not impose a license fee, royalty, or other charge for exercise of | ||
1222 | 466 | rights granted under this License, and you may not initiate litigation | ||
1223 | 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that | ||
1224 | 468 | any patent claim is infringed by making, using, selling, offering for | ||
1225 | 469 | sale, or importing the Program or any portion of it. | ||
1226 | 470 | |||
1227 | 471 | 11. Patents. | ||
1228 | 472 | |||
1229 | 473 | A "contributor" is a copyright holder who authorizes use under this | ||
1230 | 474 | License of the Program or a work on which the Program is based. The | ||
1231 | 475 | work thus licensed is called the contributor's "contributor version". | ||
1232 | 476 | |||
1233 | 477 | A contributor's "essential patent claims" are all patent claims | ||
1234 | 478 | owned or controlled by the contributor, whether already acquired or | ||
1235 | 479 | hereafter acquired, that would be infringed by some manner, permitted | ||
1236 | 480 | by this License, of making, using, or selling its contributor version, | ||
1237 | 481 | but do not include claims that would be infringed only as a | ||
1238 | 482 | consequence of further modification of the contributor version. For | ||
1239 | 483 | purposes of this definition, "control" includes the right to grant | ||
1240 | 484 | patent sublicenses in a manner consistent with the requirements of | ||
1241 | 485 | this License. | ||
1242 | 486 | |||
1243 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free | ||
1244 | 488 | patent license under the contributor's essential patent claims, to | ||
1245 | 489 | make, use, sell, offer for sale, import and otherwise run, modify and | ||
1246 | 490 | propagate the contents of its contributor version. | ||
1247 | 491 | |||
1248 | 492 | In the following three paragraphs, a "patent license" is any express | ||
1249 | 493 | agreement or commitment, however denominated, not to enforce a patent | ||
1250 | 494 | (such as an express permission to practice a patent or covenant not to | ||
1251 | 495 | sue for patent infringement). To "grant" such a patent license to a | ||
1252 | 496 | party means to make such an agreement or commitment not to enforce a | ||
1253 | 497 | patent against the party. | ||
1254 | 498 | |||
1255 | 499 | If you convey a covered work, knowingly relying on a patent license, | ||
1256 | 500 | and the Corresponding Source of the work is not available for anyone | ||
1257 | 501 | to copy, free of charge and under the terms of this License, through a | ||
1258 | 502 | publicly available network server or other readily accessible means, | ||
1259 | 503 | then you must either (1) cause the Corresponding Source to be so | ||
1260 | 504 | available, or (2) arrange to deprive yourself of the benefit of the | ||
1261 | 505 | patent license for this particular work, or (3) arrange, in a manner | ||
1262 | 506 | consistent with the requirements of this License, to extend the patent | ||
1263 | 507 | license to downstream recipients. "Knowingly relying" means you have | ||
1264 | 508 | actual knowledge that, but for the patent license, your conveying the | ||
1265 | 509 | covered work in a country, or your recipient's use of the covered work | ||
1266 | 510 | in a country, would infringe one or more identifiable patents in that | ||
1267 | 511 | country that you have reason to believe are valid. | ||
1268 | 512 | |||
1269 | 513 | If, pursuant to or in connection with a single transaction or | ||
1270 | 514 | arrangement, you convey, or propagate by procuring conveyance of, a | ||
1271 | 515 | covered work, and grant a patent license to some of the parties | ||
1272 | 516 | receiving the covered work authorizing them to use, propagate, modify | ||
1273 | 517 | or convey a specific copy of the covered work, then the patent license | ||
1274 | 518 | you grant is automatically extended to all recipients of the covered | ||
1275 | 519 | work and works based on it. | ||
1276 | 520 | |||
1277 | 521 | A patent license is "discriminatory" if it does not include within | ||
1278 | 522 | the scope of its coverage, prohibits the exercise of, or is | ||
1279 | 523 | conditioned on the non-exercise of one or more of the rights that are | ||
1280 | 524 | specifically granted under this License. You may not convey a covered | ||
1281 | 525 | work if you are a party to an arrangement with a third party that is | ||
1282 | 526 | in the business of distributing software, under which you make payment | ||
1283 | 527 | to the third party based on the extent of your activity of conveying | ||
1284 | 528 | the work, and under which the third party grants, to any of the | ||
1285 | 529 | parties who would receive the covered work from you, a discriminatory | ||
1286 | 530 | patent license (a) in connection with copies of the covered work | ||
1287 | 531 | conveyed by you (or copies made from those copies), or (b) primarily | ||
1288 | 532 | for and in connection with specific products or compilations that | ||
1289 | 533 | contain the covered work, unless you entered into that arrangement, | ||
1290 | 534 | or that patent license was granted, prior to 28 March 2007. | ||
1291 | 535 | |||
1292 | 536 | Nothing in this License shall be construed as excluding or limiting | ||
1293 | 537 | any implied license or other defenses to infringement that may | ||
1294 | 538 | otherwise be available to you under applicable patent law. | ||
1295 | 539 | |||
1296 | 540 | 12. No Surrender of Others' Freedom. | ||
1297 | 541 | |||
1298 | 542 | If conditions are imposed on you (whether by court order, agreement or | ||
1299 | 543 | otherwise) that contradict the conditions of this License, they do not | ||
1300 | 544 | excuse you from the conditions of this License. If you cannot convey a | ||
1301 | 545 | covered work so as to satisfy simultaneously your obligations under this | ||
1302 | 546 | License and any other pertinent obligations, then as a consequence you may | ||
1303 | 547 | not convey it at all. For example, if you agree to terms that obligate you | ||
1304 | 548 | to collect a royalty for further conveying from those to whom you convey | ||
1305 | 549 | the Program, the only way you could satisfy both those terms and this | ||
1306 | 550 | License would be to refrain entirely from conveying the Program. | ||
1307 | 551 | |||
1308 | 552 | 13. Use with the GNU Affero General Public License. | ||
1309 | 553 | |||
1310 | 554 | Notwithstanding any other provision of this License, you have | ||
1311 | 555 | permission to link or combine any covered work with a work licensed | ||
1312 | 556 | under version 3 of the GNU Affero General Public License into a single | ||
1313 | 557 | combined work, and to convey the resulting work. The terms of this | ||
1314 | 558 | License will continue to apply to the part which is the covered work, | ||
1315 | 559 | but the special requirements of the GNU Affero General Public License, | ||
1316 | 560 | section 13, concerning interaction through a network will apply to the | ||
1317 | 561 | combination as such. | ||
1318 | 562 | |||
1319 | 563 | 14. Revised Versions of this License. | ||
1320 | 564 | |||
1321 | 565 | The Free Software Foundation may publish revised and/or new versions of | ||
1322 | 566 | the GNU General Public License from time to time. Such new versions will | ||
1323 | 567 | be similar in spirit to the present version, but may differ in detail to | ||
1324 | 568 | address new problems or concerns. | ||
1325 | 569 | |||
1326 | 570 | Each version is given a distinguishing version number. If the | ||
1327 | 571 | Program specifies that a certain numbered version of the GNU General | ||
1328 | 572 | Public License "or any later version" applies to it, you have the | ||
1329 | 573 | option of following the terms and conditions either of that numbered | ||
1330 | 574 | version or of any later version published by the Free Software | ||
1331 | 575 | Foundation. If the Program does not specify a version number of the | ||
1332 | 576 | GNU General Public License, you may choose any version ever published | ||
1333 | 577 | by the Free Software Foundation. | ||
1334 | 578 | |||
1335 | 579 | If the Program specifies that a proxy can decide which future | ||
1336 | 580 | versions of the GNU General Public License can be used, that proxy's | ||
1337 | 581 | public statement of acceptance of a version permanently authorizes you | ||
1338 | 582 | to choose that version for the Program. | ||
1339 | 583 | |||
1340 | 584 | Later license versions may give you additional or different | ||
1341 | 585 | permissions. However, no additional obligations are imposed on any | ||
1342 | 586 | author or copyright holder as a result of your choosing to follow a | ||
1343 | 587 | later version. | ||
1344 | 588 | |||
1345 | 589 | 15. Disclaimer of Warranty. | ||
1346 | 590 | |||
1347 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY | ||
1348 | 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT | ||
1349 | 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY | ||
1350 | 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, | ||
1351 | 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
1352 | 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM | ||
1353 | 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF | ||
1354 | 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. | ||
1355 | 599 | |||
1356 | 600 | 16. Limitation of Liability. | ||
1357 | 601 | |||
1358 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING | ||
1359 | 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS | ||
1360 | 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY | ||
1361 | 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE | ||
1362 | 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF | ||
1363 | 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD | ||
1364 | 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), | ||
1365 | 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF | ||
1366 | 610 | SUCH DAMAGES. | ||
1367 | 611 | |||
1368 | 612 | 17. Interpretation of Sections 15 and 16. | ||
1369 | 613 | |||
1370 | 614 | If the disclaimer of warranty and limitation of liability provided | ||
1371 | 615 | above cannot be given local legal effect according to their terms, | ||
1372 | 616 | reviewing courts shall apply local law that most closely approximates | ||
1373 | 617 | an absolute waiver of all civil liability in connection with the | ||
1374 | 618 | Program, unless a warranty or assumption of liability accompanies a | ||
1375 | 619 | copy of the Program in return for a fee. | ||
1376 | 620 | |||
1377 | 621 | END OF TERMS AND CONDITIONS | ||
1378 | 622 | |||
1379 | 623 | How to Apply These Terms to Your New Programs | ||
1380 | 624 | |||
1381 | 625 | If you develop a new program, and you want it to be of the greatest | ||
1382 | 626 | possible use to the public, the best way to achieve this is to make it | ||
1383 | 627 | free software which everyone can redistribute and change under these terms. | ||
1384 | 628 | |||
1385 | 629 | To do so, attach the following notices to the program. It is safest | ||
1386 | 630 | to attach them to the start of each source file to most effectively | ||
1387 | 631 | state the exclusion of warranty; and each file should have at least | ||
1388 | 632 | the "copyright" line and a pointer to where the full notice is found. | ||
1389 | 633 | |||
1390 | 634 | <one line to give the program's name and a brief idea of what it does.> | ||
1391 | 635 | Copyright (C) <year> <name of author> | ||
1392 | 636 | |||
1393 | 637 | This program is free software: you can redistribute it and/or modify | ||
1394 | 638 | it under the terms of the GNU General Public License as published by | ||
1395 | 639 | the Free Software Foundation, either version 3 of the License, or | ||
1396 | 640 | (at your option) any later version. | ||
1397 | 641 | |||
1398 | 642 | This program is distributed in the hope that it will be useful, | ||
1399 | 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1400 | 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1401 | 645 | GNU General Public License for more details. | ||
1402 | 646 | |||
1403 | 647 | You should have received a copy of the GNU General Public License | ||
1404 | 648 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
1405 | 649 | |||
1406 | 650 | Also add information on how to contact you by electronic and paper mail. | ||
1407 | 651 | |||
1408 | 652 | If the program does terminal interaction, make it output a short | ||
1409 | 653 | notice like this when it starts in an interactive mode: | ||
1410 | 654 | |||
1411 | 655 | <program> Copyright (C) <year> <name of author> | ||
1412 | 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. | ||
1413 | 657 | This is free software, and you are welcome to redistribute it | ||
1414 | 658 | under certain conditions; type `show c' for details. | ||
1415 | 659 | |||
1416 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate | ||
1417 | 661 | parts of the General Public License. Of course, your program's commands | ||
1418 | 662 | might be different; for a GUI interface, you would use an "about box". | ||
1419 | 663 | |||
1420 | 664 | You should also get your employer (if you work as a programmer) or school, | ||
1421 | 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. | ||
1422 | 666 | For more information on this, and how to apply and follow the GNU GPL, see | ||
1423 | 667 | <http://www.gnu.org/licenses/>. | ||
1424 | 668 | |||
1425 | 669 | The GNU General Public License does not permit incorporating your program | ||
1426 | 670 | into proprietary programs. If your program is a subroutine library, you | ||
1427 | 671 | may consider it more useful to permit linking proprietary applications with | ||
1428 | 672 | the library. If this is what you want to do, use the GNU Lesser General | ||
1429 | 673 | Public License instead of this License. But first, please read | ||
1430 | 674 | <http://www.gnu.org/philosophy/why-not-lgpl.html>. | ||
1431 | 675 | 0 | ||
1432 | === modified file 'Frogger/README' | |||
1433 | --- Frogger/README 2010-01-29 23:57:26 +0000 | |||
1434 | +++ Frogger/README 2010-03-12 10:44:17 +0000 | |||
1435 | @@ -1,49 +1,69 @@ | |||
1442 | 1 | Frog Game is (C) Daniel Bell <daniel.bell@saraclan.com>, 2009-2010. | 1 | Copyright (C) 2009, 2010 Daniel Bell <daniel.bell@saraclan.com> |
1443 | 2 | 2 | ||
1444 | 3 | About: | 3 | BACKGROUND: |
1445 | 4 | 4 | Frog Game is a fun survival/rescue game loosely based upon the awesome arcade game: Frogger. | |
1446 | 5 | Frog Game is a fun survival game based upon the awesome arcade game: Frogger. | 5 | |
1447 | 6 | This game was originally created by Daniel Bell as a University project for a first year module in 2009. | 6 | This game was originally created by as a University project for a module in the first year. |
1448 | 7 | It was created using Visual Studio 2008 and the objective was to create a prototype game, | 7 | It was created using Visual Studio 2008 and the objective was to create a prototype game, |
1451 | 8 | after the module I decided that I actually wanted to convert the prototype into an actual game | 8 | to demonstrate the game concepts of the design to the class. After completing the module |
1452 | 9 | that people can run on all platforms (Linux, Mac OSX and Windows). | 9 | I decided that I actually wanted to play this game on my system. (Visual Studio creates |
1453 | 10 | windows applications, and since I use Linux and Mac OSX the version created by Visual | ||
1454 | 11 | Studio was not suitable). Frog Game is now using Python as its platform and uses the | ||
1455 | 12 | pygame library (http://pygame.org). As a result Frog Game now has support on Windows, | ||
1456 | 13 | Linux and Mac OSX - and any other operating system where python and pygame are supported). | ||
1457 | 10 | 14 | ||
1461 | 11 | You can find more information about the prototype version of Frog Game: | 15 | The following links have more information about the prototype version of Frog Game: |
1462 | 12 | * http://saraclan.com/portfolio/project/Frogger | 16 | * http://saraclan.com/portfolio/project/Frogger (My Portfolio - holding details of the project) |
1463 | 13 | * http://git.saraclan.com/index.php?p=frogger.git | 17 | * http://git.saraclan.com/index.php?p=frogger.git (GIT repository of the prototype) |
1464 | 14 | 18 | ||
1465 | 15 | Information about the current project can be found here: | 19 | Information about the current project can be found here: |
1466 | 16 | * https://launchpad.net/frogger | 20 | * https://launchpad.net/frogger |
1467 | 17 | 21 | ||
1500 | 18 | Artwork: | 22 | GAME OBJECTIVES: |
1501 | 19 | 23 | The objectives of Frog Game are to rescue the lost baby frogs and to get them home safe! | |
1502 | 20 | The artwork of frog game was created by Daniel Bell (C) 2009-2010. | 24 | |
1503 | 21 | 25 | As a player you control the Big Frog and it is your job to collect the frogs one at a time | |
1504 | 22 | Game Code: | 26 | and bring them back to the start. Avoiding the obstacles and hazards on the way is essential |
1505 | 23 | 27 | for maximum point scoring as when you die the frog you were rescuing dies also. | |
1506 | 24 | The game code for Frog Game was written by Daniel Bell (C) 2009-2010. | 28 | |
1507 | 25 | Frog Game is a python application and utilises the pygame library (http://pygame.org) - LGPLv2 licenced. | 29 | The scoring system takes into account how fast it took you to rescue the baby frog and |
1508 | 26 | Frog Game has been tested using Python 2.5.x and 2.6.x on Windows, 2.6.x on Linux and 2.5 and 2.6 on Mac OS X. | 30 | your past deaths (if any). |
1509 | 27 | 31 | ||
1510 | 28 | Running the game: | 32 | A new level begins when there are no baby frogs left to save and you have at least 1 life still |
1511 | 29 | 33 | remaining. | |
1512 | 30 | To run this game, you require a version of Python (http://python.org) of at least 2.5 or 2.6 (other versions may work, | 34 | |
1513 | 31 | but are not supported.) and pygame (http://pygame.org) of 1.9.0 (older versions such as 1.7.1 or 1.8.0 may be work, but | 35 | ARTWORK: |
1514 | 32 | cannot be supported.) | 36 | The artwork of frog game was created by Daniel Bell Copyright (C) 2009, 2010. |
1515 | 33 | 37 | ||
1516 | 34 | You can run this game via the command-line by running the following command: python frogger.py | 38 | RUNNING FROM SOURCE: |
1517 | 35 | You can also right click the frogger.py script and open it with the Python Interpreter. | 39 | Frog Game has the following dependencies: |
1518 | 36 | 40 | * Python - 2.5+ (Tested it on 2.5 and 2.6 - lower versions may be supported) | |
1519 | 37 | There are intallers and binaries available at http://launchpad.net/frogger | 41 | * Pygame library - 1.9+ (Tested it on 1.9.1 - lower versions may be supported) |
1520 | 38 | 42 | ||
1521 | 39 | Game Licence: | 43 | On Windows: |
1522 | 40 | 44 | Right click frogger.py and select "open with Python Interpreter". | |
1523 | 41 | Frog Game is licenced under the GNU General Public Licence v3. More details can be found in the LICENCE file | 45 | Double clicking may automatically run the game code. |
1524 | 42 | if you did not recieve a LICENCE file, you can find more information at the Free Software Foundations website: | 46 | On Mac: |
1525 | 43 | http://www.gnu.org/licenses/gpl-3.0.txt | 47 | Right click and in the Open With menu select Python Launcher |
1526 | 44 | 48 | On Linux: | |
1527 | 45 | Game Dependencies: | 49 | Using the terminal navigate to the folder containing the source code and run |
1528 | 46 | 50 | this command: "python frogger.py" | |
1529 | 47 | As mentioned above, the dependancies for Frog Game are: Python 2.5 or greater, and Pygame 1.9.1. | 51 | |
1530 | 48 | Python can be found at: http://python.org | 52 | There are installers and binaries available at http://launchpad.net/frogger |
1531 | 49 | Pygame can be found at: http://pygame.org | 53 | |
1532 | 54 | LICENSE: | ||
1533 | 55 | Frog Game is licensed under the GNU General Public License v3. More details can be found | ||
1534 | 56 | in the LICENSE file. If you did not receive a LICENSE file, you can find more information | ||
1535 | 57 | at the Free Software Foundations website: http://www.gnu.org/licenses/gpl-3.0.txt | ||
1536 | 58 | |||
1537 | 59 | CONTRIBUTING: | ||
1538 | 60 | You can help the project in many ways through either submitting art, feature requests, fixing bugs | ||
1539 | 61 | and so on. Please see our launchpad project page: https://launchpad.net/frogger and contact | ||
1540 | 62 | daniel.bell@saraclan.com | ||
1541 | 63 | |||
1542 | 64 | SUPPORT: | ||
1543 | 65 | If you come across any issues or abnormalities with Frog Game support is available on our | ||
1544 | 66 | launchpad page: https://launchpad.net/frogger on our launchpad page you can file bugs and | ||
1545 | 67 | ask questions. | ||
1546 | 68 | |||
1547 | 69 | Please don't hesitate to report bugs or ask questions on even the most trivial of issues. | ||
1548 | 50 | 70 | ||
1549 | === removed file 'Frogger/data/fonts/bgrovealtb.ttf' | |||
1550 | 51 | Binary files Frogger/data/fonts/bgrovealtb.ttf 2010-01-25 14:59:15 +0000 and Frogger/data/fonts/bgrovealtb.ttf 1970-01-01 00:00:00 +0000 differ | 71 | Binary files Frogger/data/fonts/bgrovealtb.ttf 2010-01-25 14:59:15 +0000 and Frogger/data/fonts/bgrovealtb.ttf 1970-01-01 00:00:00 +0000 differ |
1551 | === added file 'Frogger/data/fonts/nibby.ttf' | |||
1552 | 52 | Binary files Frogger/data/fonts/nibby.ttf 1970-01-01 00:00:00 +0000 and Frogger/data/fonts/nibby.ttf 2010-03-12 10:44:17 +0000 differ | 72 | Binary files Frogger/data/fonts/nibby.ttf 1970-01-01 00:00:00 +0000 and Frogger/data/fonts/nibby.ttf 2010-03-12 10:44:17 +0000 differ |
1553 | === added file 'Frogger/data/frog-game.desktop' | |||
1554 | --- Frogger/data/frog-game.desktop 1970-01-01 00:00:00 +0000 | |||
1555 | +++ Frogger/data/frog-game.desktop 2010-03-12 10:44:17 +0000 | |||
1556 | @@ -0,0 +1,10 @@ | |||
1557 | 1 | #!/usr/bin/env xdg-open | ||
1558 | 2 | |||
1559 | 3 | [Desktop Entry] | ||
1560 | 4 | Name=Frog Game | ||
1561 | 5 | Comment=Fun survival/rescue game! | ||
1562 | 6 | Exec=frogger | ||
1563 | 7 | Icon=frog-game | ||
1564 | 8 | Terminal=false | ||
1565 | 9 | Type=Application | ||
1566 | 10 | Categories=Game;ArcadeGame; | ||
1567 | 0 | 11 | ||
1568 | === added directory 'Frogger/data/icons' | |||
1569 | === added directory 'Frogger/data/icons/16x16' | |||
1570 | === added file 'Frogger/data/icons/16x16/frog-game.png' | |||
1571 | 1 | Binary files Frogger/data/icons/16x16/frog-game.png 1970-01-01 00:00:00 +0000 and Frogger/data/icons/16x16/frog-game.png 2010-03-12 10:44:17 +0000 differ | 12 | Binary files Frogger/data/icons/16x16/frog-game.png 1970-01-01 00:00:00 +0000 and Frogger/data/icons/16x16/frog-game.png 2010-03-12 10:44:17 +0000 differ |
1572 | === added directory 'Frogger/data/icons/22x22' | |||
1573 | === added file 'Frogger/data/icons/22x22/frog-game.png' | |||
1574 | 2 | Binary files Frogger/data/icons/22x22/frog-game.png 1970-01-01 00:00:00 +0000 and Frogger/data/icons/22x22/frog-game.png 2010-03-12 10:44:17 +0000 differ | 13 | Binary files Frogger/data/icons/22x22/frog-game.png 1970-01-01 00:00:00 +0000 and Frogger/data/icons/22x22/frog-game.png 2010-03-12 10:44:17 +0000 differ |
1575 | === added directory 'Frogger/data/icons/24x24' | |||
1576 | === added file 'Frogger/data/icons/24x24/frog-game.png' | |||
1577 | 3 | Binary files Frogger/data/icons/24x24/frog-game.png 1970-01-01 00:00:00 +0000 and Frogger/data/icons/24x24/frog-game.png 2010-03-12 10:44:17 +0000 differ | 14 | Binary files Frogger/data/icons/24x24/frog-game.png 1970-01-01 00:00:00 +0000 and Frogger/data/icons/24x24/frog-game.png 2010-03-12 10:44:17 +0000 differ |
1578 | === added directory 'Frogger/data/icons/48x48' | |||
1579 | === added file 'Frogger/data/icons/48x48/frog-game.png' | |||
1580 | 4 | Binary files Frogger/data/icons/48x48/frog-game.png 1970-01-01 00:00:00 +0000 and Frogger/data/icons/48x48/frog-game.png 2010-03-12 10:44:17 +0000 differ | 15 | Binary files Frogger/data/icons/48x48/frog-game.png 1970-01-01 00:00:00 +0000 and Frogger/data/icons/48x48/frog-game.png 2010-03-12 10:44:17 +0000 differ |
1581 | === added file 'Frogger/data/icons/frog-game.icns' | |||
1582 | 5 | Binary files Frogger/data/icons/frog-game.icns 1970-01-01 00:00:00 +0000 and Frogger/data/icons/frog-game.icns 2010-03-12 10:44:17 +0000 differ | 16 | Binary files Frogger/data/icons/frog-game.icns 1970-01-01 00:00:00 +0000 and Frogger/data/icons/frog-game.icns 2010-03-12 10:44:17 +0000 differ |
1583 | === added file 'Frogger/data/icons/frog-game.ico' | |||
1584 | 6 | Binary files Frogger/data/icons/frog-game.ico 1970-01-01 00:00:00 +0000 and Frogger/data/icons/frog-game.ico 2010-03-12 10:44:17 +0000 differ | 17 | Binary files Frogger/data/icons/frog-game.ico 1970-01-01 00:00:00 +0000 and Frogger/data/icons/frog-game.ico 2010-03-12 10:44:17 +0000 differ |
1585 | === added directory 'Frogger/data/icons/scalable' | |||
1586 | === added file 'Frogger/data/icons/scalable/frog-game.svg' | |||
1587 | --- Frogger/data/icons/scalable/frog-game.svg 1970-01-01 00:00:00 +0000 | |||
1588 | +++ Frogger/data/icons/scalable/frog-game.svg 2010-03-12 10:44:17 +0000 | |||
1589 | @@ -0,0 +1,68 @@ | |||
1590 | 1 | <?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
1591 | 2 | <!-- Created with Inkscape (http://www.inkscape.org/) --> | ||
1592 | 3 | |||
1593 | 4 | <svg | ||
1594 | 5 | xmlns:dc="http://purl.org/dc/elements/1.1/" | ||
1595 | 6 | xmlns:cc="http://creativecommons.org/ns#" | ||
1596 | 7 | xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" | ||
1597 | 8 | xmlns:svg="http://www.w3.org/2000/svg" | ||
1598 | 9 | xmlns="http://www.w3.org/2000/svg" | ||
1599 | 10 | xmlns:xlink="http://www.w3.org/1999/xlink" | ||
1600 | 11 | xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" | ||
1601 | 12 | xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" | ||
1602 | 13 | id="svg2" | ||
1603 | 14 | version="1.1" | ||
1604 | 15 | inkscape:version="0.47 r22583" | ||
1605 | 16 | width="20" | ||
1606 | 17 | height="17" | ||
1607 | 18 | sodipodi:docname="life.gif"> | ||
1608 | 19 | <metadata | ||
1609 | 20 | id="metadata8"> | ||
1610 | 21 | <rdf:RDF> | ||
1611 | 22 | <cc:Work | ||
1612 | 23 | rdf:about=""> | ||
1613 | 24 | <dc:format>image/svg+xml</dc:format> | ||
1614 | 25 | <dc:type | ||
1615 | 26 | rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> | ||
1616 | 27 | <dc:title></dc:title> | ||
1617 | 28 | </cc:Work> | ||
1618 | 29 | </rdf:RDF> | ||
1619 | 30 | </metadata> | ||
1620 | 31 | <defs | ||
1621 | 32 | id="defs6"> | ||
1622 | 33 | <inkscape:perspective | ||
1623 | 34 | sodipodi:type="inkscape:persp3d" | ||
1624 | 35 | inkscape:vp_x="0 : 0.5 : 1" | ||
1625 | 36 | inkscape:vp_y="0 : 1000 : 0" | ||
1626 | 37 | inkscape:vp_z="1 : 0.5 : 1" | ||
1627 | 38 | inkscape:persp3d-origin="0.5 : 0.33333333 : 1" | ||
1628 | 39 | id="perspective10" /> | ||
1629 | 40 | </defs> | ||
1630 | 41 | <sodipodi:namedview | ||
1631 | 42 | pagecolor="#ffffff" | ||
1632 | 43 | bordercolor="#666666" | ||
1633 | 44 | borderopacity="1" | ||
1634 | 45 | objecttolerance="10" | ||
1635 | 46 | gridtolerance="10" | ||
1636 | 47 | guidetolerance="10" | ||
1637 | 48 | inkscape:pageopacity="0" | ||
1638 | 49 | inkscape:pageshadow="2" | ||
1639 | 50 | inkscape:window-width="640" | ||
1640 | 51 | inkscape:window-height="487" | ||
1641 | 52 | id="namedview4" | ||
1642 | 53 | showgrid="false" | ||
1643 | 54 | inkscape:zoom="13.882353" | ||
1644 | 55 | inkscape:cx="10" | ||
1645 | 56 | inkscape:cy="8.5" | ||
1646 | 57 | inkscape:window-x="0" | ||
1647 | 58 | inkscape:window-y="25" | ||
1648 | 59 | inkscape:window-maximized="0" | ||
1649 | 60 | inkscape:current-layer="svg2" /> | ||
1650 | 61 | <image | ||
1651 | 62 | xlink:href="file:///home/dbell/Documents/frog-game-0.2.0/life.gif" | ||
1652 | 63 | width="20" | ||
1653 | 64 | height="17" | ||
1654 | 65 | id="image12" | ||
1655 | 66 | x="0" | ||
1656 | 67 | y="0" /> | ||
1657 | 68 | </svg> | ||
1658 | 0 | 69 | ||
1659 | === modified file 'Frogger/data/images/background.png' (properties changed: +x to -x) | |||
1660 | 1 | Binary files Frogger/data/images/background.png 2010-01-27 18:36:42 +0000 and Frogger/data/images/background.png 2010-03-12 10:44:17 +0000 differ | 70 | Binary files Frogger/data/images/background.png 2010-01-27 18:36:42 +0000 and Frogger/data/images/background.png 2010-03-12 10:44:17 +0000 differ |
1661 | === modified file 'Frogger/data/images/betterfrog.gif' | |||
1662 | 2 | Binary files Frogger/data/images/betterfrog.gif 2010-01-28 16:09:09 +0000 and Frogger/data/images/betterfrog.gif 2010-03-12 10:44:17 +0000 differ | 71 | Binary files Frogger/data/images/betterfrog.gif 2010-01-28 16:09:09 +0000 and Frogger/data/images/betterfrog.gif 2010-03-12 10:44:17 +0000 differ |
1663 | === added file 'Frogger/data/images/frogcarry.gif' | |||
1664 | 3 | Binary files Frogger/data/images/frogcarry.gif 1970-01-01 00:00:00 +0000 and Frogger/data/images/frogcarry.gif 2010-03-12 10:44:17 +0000 differ | 72 | Binary files Frogger/data/images/frogcarry.gif 1970-01-01 00:00:00 +0000 and Frogger/data/images/frogcarry.gif 2010-03-12 10:44:17 +0000 differ |
1665 | === modified file 'Frogger/data/images/log.gif' | |||
1666 | 4 | Binary files Frogger/data/images/log.gif 2010-01-28 16:09:09 +0000 and Frogger/data/images/log.gif 2010-03-12 10:44:17 +0000 differ | 73 | Binary files Frogger/data/images/log.gif 2010-01-28 16:09:09 +0000 and Frogger/data/images/log.gif 2010-03-12 10:44:17 +0000 differ |
1667 | === added file 'Frogger/frogger' | |||
1668 | --- Frogger/frogger 1970-01-01 00:00:00 +0000 | |||
1669 | +++ Frogger/frogger 2010-03-12 10:44:17 +0000 | |||
1670 | @@ -0,0 +1,561 @@ | |||
1671 | 1 | #!/usr/bin/env python | ||
1672 | 2 | |||
1673 | 3 | ###BEGIN LICENSE | ||
1674 | 4 | # Copyright (C) 2010 Daniel Bell <daniel.bell@saraclan.com> | ||
1675 | 5 | # | ||
1676 | 6 | #This program is free software: you can redistribute it and/or modify it | ||
1677 | 7 | #under the terms of the GNU General Public License version 3, as published | ||
1678 | 8 | #by the Free Software Foundation. | ||
1679 | 9 | # | ||
1680 | 10 | #This program is distributed in the hope that it will be useful, but | ||
1681 | 11 | #WITHOUT ANY WARRANTY; without even the implied warranties of | ||
1682 | 12 | #MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR | ||
1683 | 13 | #PURPOSE. See the GNU General Public License for more details. | ||
1684 | 14 | # | ||
1685 | 15 | #You should have received a copy of the GNU General Public License along | ||
1686 | 16 | #with this program. If not, see <http://www.gnu.org/licenses/>. | ||
1687 | 17 | ### END LICENSE | ||
1688 | 18 | |||
1689 | 19 | import os | ||
1690 | 20 | import pygame | ||
1691 | 21 | from pygame.locals import * | ||
1692 | 22 | import sys | ||
1693 | 23 | import time | ||
1694 | 24 | |||
1695 | 25 | from lib.sprites import (Leftcar, Rightcar, Homefrog, Log, Life, Frog) | ||
1696 | 26 | from lib.engine import * | ||
1697 | 27 | |||
1698 | 28 | #Declare global variables: | ||
1699 | 29 | global screen | ||
1700 | 30 | global resolution #,display_flag, color_depth | ||
1701 | 31 | global caption, logo | ||
1702 | 32 | global clock | ||
1703 | 33 | global level, speed | ||
1704 | 34 | global font | ||
1705 | 35 | |||
1706 | 36 | resolution = (800,600) | ||
1707 | 37 | #display_flag = DOUBLEBUF | ||
1708 | 38 | #color_depth = 32 | ||
1709 | 39 | caption = "Frog Game" | ||
1710 | 40 | logo = "data/images/life.gif" | ||
1711 | 41 | |||
1712 | 42 | clock = pygame.time.Clock() | ||
1713 | 43 | |||
1714 | 44 | level = 1 | ||
1715 | 45 | |||
1716 | 46 | #Travel speed - logs and cars. | ||
1717 | 47 | #Unit is pixels? Remember game runs at 30 fps, so each second unit travels speed*30 | ||
1718 | 48 | speed = 4 | ||
1719 | 49 | |||
1720 | 50 | #Initialize pygame, and setup the screen, captions and logo. | ||
1721 | 51 | #TODO: Find out if logo actually works in binaries. | ||
1722 | 52 | pygame.init() | ||
1723 | 53 | pygame.display.set_caption(caption) | ||
1724 | 54 | pygame.display.set_icon(pygame.image.load(logo)) | ||
1725 | 55 | #No longer specifying flag and depth, not required | ||
1726 | 56 | #and could restrict the portability of the game by limiting devices. | ||
1727 | 57 | screen = pygame.display.set_mode(resolution) | ||
1728 | 58 | |||
1729 | 59 | def main(): | ||
1730 | 60 | """Main function - handles logic to act out the game. | ||
1731 | 61 | Calls menu() to display the game menu | ||
1732 | 62 | """ | ||
1733 | 63 | #Call menu() to display menu to allow game to be played. | ||
1734 | 64 | menu() | ||
1735 | 65 | |||
1736 | 66 | def instructions(): | ||
1737 | 67 | """ Instruction Screen: call this when you want to display how to play the game | ||
1738 | 68 | """ | ||
1739 | 69 | screen = pygame.display.set_mode(resolution) | ||
1740 | 70 | |||
1741 | 71 | #Print text to the screen. | ||
1742 | 72 | font_write("INSTRUCTIONS", 72, True, (0, 0, 255), 0, (150, 100), screen) | ||
1743 | 73 | |||
1744 | 74 | font_write("The objectives of Frog Game are to rescue the lost baby frogs and to get them home safe!", 14, True, (0, 0, 255), 0, (80, 180), screen) | ||
1745 | 75 | |||
1746 | 76 | font_write("As a player you control the Big Frog and it is your job to collect", 18, True, (0, 0, 255), 0, (110, 220), screen) | ||
1747 | 77 | font_write("the frogs one at a time and bring them back to the start. Avoiding", 18, True, (0, 0, 255), 0, (110, 240), screen) | ||
1748 | 78 | font_write("the obstacles and hazards on the way is essential for maximum point", 18, True, (0, 0, 255), 0, (110, 260), screen) | ||
1749 | 79 | font_write("scoring as when you die the frog you were rescuing dies also.", 18, True, (0, 0, 255), 0, (110, 280), screen) | ||
1750 | 80 | |||
1751 | 81 | font_write("The scoring system takes into account how fast it took you to", 18, True, (0, 0, 255), 0, (110, 320), screen) | ||
1752 | 82 | font_write("rescue the baby frog and your past deaths (if any).", 18, True, (0, 0, 255), 0, (110, 340), screen) | ||
1753 | 83 | |||
1754 | 84 | font_write("A new level begins when there are no baby frogs left to save", 18, True, (0, 0, 255), 0, (110, 380), screen) | ||
1755 | 85 | font_write("and you have at least 1 life still remaining.", 18, True, (0, 0, 255), 0, (110, 400), screen) | ||
1756 | 86 | |||
1757 | 87 | font_write("Press <SPACE> to return to Menu", 24, True, (0, 0, 255), 0, (200, 500), screen) | ||
1758 | 88 | font_write("ESC to exit", 18, True, (0, 0, 255), 0, (0, 0), screen) | ||
1759 | 89 | |||
1760 | 90 | pygame.display.flip() #update display - just once not in loop. | ||
1761 | 91 | #Main loop: | ||
1762 | 92 | while 1: | ||
1763 | 93 | #Were looking for certain events only within the game over menu. | ||
1764 | 94 | #ESC or mouse-clicking the 'X' to exit the game | ||
1765 | 95 | #SPACEBAR to start a new game. | ||
1766 | 96 | for event in pygame.event.get(): | ||
1767 | 97 | if event.type == QUIT or (event.type == KEYDOWN and event.key == K_ESCAPE): | ||
1768 | 98 | sys.exit() | ||
1769 | 99 | if event.type == KEYDOWN and event.key == K_SPACE: | ||
1770 | 100 | menu() | ||
1771 | 101 | |||
1772 | 102 | #We need to ensure game is limited to 30FPS in order to control CPU | ||
1773 | 103 | clock.tick(30) | ||
1774 | 104 | |||
1775 | 105 | def game_over_screen(score): | ||
1776 | 106 | """ This method is called when you wish to display the Game Over Screen. | ||
1777 | 107 | Clears the screen and prints data about the past game: score, level | ||
1778 | 108 | and a way to exit or start a new game. | ||
1779 | 109 | |||
1780 | 110 | :param score: The score the player achieved before Game Over. | ||
1781 | 111 | :type score: ``int`` | ||
1782 | 112 | :param level: The level the player achieved. | ||
1783 | 113 | :type level: ``int`` | ||
1784 | 114 | """ | ||
1785 | 115 | |||
1786 | 116 | #Clear the screen so that it can be printed on. | ||
1787 | 117 | screen = pygame.display.set_mode(resolution) | ||
1788 | 118 | |||
1789 | 119 | #Print text to the screen. | ||
1790 | 120 | font_write("GAME OVER", 72, True, (0, 0, 255), 0, (210, 100), screen) | ||
1791 | 121 | font_write("You Scored " + str(score) + " points!", 28, True, (0, 0, 255), 0, (230, 180), screen) | ||
1792 | 122 | font_write("Highest level achieved: " + str(level), 28, True, (0, 0, 255), 0, (230, 210), screen) | ||
1793 | 123 | font_write("Press <SPACE> to Start a New Game", 24, True, (0, 0, 255), 0, (200, 500), screen) | ||
1794 | 124 | font_write("ESC to exit", 18, True, (0, 0, 255), 0, (0, 0), screen) | ||
1795 | 125 | |||
1796 | 126 | pygame.display.flip() #update display - just once not in loop. | ||
1797 | 127 | #Main loop: | ||
1798 | 128 | while 1: | ||
1799 | 129 | #Were looking for certain events only within the game over menu. | ||
1800 | 130 | #ESC or mouse-clicking the 'X' to exit the game | ||
1801 | 131 | #SPACEBAR to start a new game. | ||
1802 | 132 | for event in pygame.event.get(): | ||
1803 | 133 | if event.type == QUIT or (event.type == KEYDOWN and event.key == K_ESCAPE): | ||
1804 | 134 | sys.exit() | ||
1805 | 135 | if event.type == KEYDOWN and event.key == K_SPACE: | ||
1806 | 136 | game() | ||
1807 | 137 | |||
1808 | 138 | #We need to ensure game is limited to 30FPS in order to control CPU | ||
1809 | 139 | clock.tick(30) | ||
1810 | 140 | |||
1811 | 141 | def menu(): | ||
1812 | 142 | """ This method is called when you wish to display the STARTUP menu. | ||
1813 | 143 | This menu is the entry point to the game, it contains logic that | ||
1814 | 144 | allows the player to play the game, exit (and so on). | ||
1815 | 145 | """ | ||
1816 | 146 | #Clear screen. | ||
1817 | 147 | screen = pygame.display.set_mode(resolution) | ||
1818 | 148 | |||
1819 | 149 | #Print text to screen. | ||
1820 | 150 | font_write("FROG GAME", 72, True, (0, 0, 255), 0, (210, 200), screen) | ||
1821 | 151 | font_write("Welcome To", 32, True, (0, 0, 255), 0, (305, 175), screen) | ||
1822 | 152 | font_write("Press <I> for Instructions", 24, True, (0, 0, 255), 0, (240, 480), screen) | ||
1823 | 153 | font_write("Press <SPACE> to Continue", 24, True, (0, 0, 255), 0, (247, 500), screen) | ||
1824 | 154 | font_write("ESC to exit", 18, True, (0, 0, 255), 0, (0, 0), screen) | ||
1825 | 155 | |||
1826 | 156 | pygame.display.flip() | ||
1827 | 157 | #Main loop: | ||
1828 | 158 | while 1: | ||
1829 | 159 | for event in pygame.event.get(): | ||
1830 | 160 | if event.type == QUIT or (event.type == KEYDOWN and event.key == K_ESCAPE): | ||
1831 | 161 | sys.exit() | ||
1832 | 162 | if event.type == KEYDOWN and event.key == K_SPACE: | ||
1833 | 163 | game() | ||
1834 | 164 | if event.type ==KEYDOWN and event.key == K_i: | ||
1835 | 165 | instructions() | ||
1836 | 166 | |||
1837 | 167 | clock.tick(30) | ||
1838 | 168 | |||
1839 | 169 | def game(): | ||
1840 | 170 | #starting game needs to be on level 1. | ||
1841 | 171 | global level, speed | ||
1842 | 172 | level =1 | ||
1843 | 173 | speed = 4 | ||
1844 | 174 | """ This method contains all the logic for the actual game. | ||
1845 | 175 | This is to be called when the player wants to play the game. | ||
1846 | 176 | """ | ||
1847 | 177 | #Clear screen. | ||
1848 | 178 | screen = pygame.display.set_mode(resolution) | ||
1849 | 179 | |||
1850 | 180 | #Setup the background. | ||
1851 | 181 | backgroundImage = 'data/images/background.png' | ||
1852 | 182 | background = pygame.image.load(backgroundImage).convert() | ||
1853 | 183 | screen.blit(background, (0,0)) | ||
1854 | 184 | pygame.display.update() | ||
1855 | 185 | |||
1856 | 186 | #Create player character. | ||
1857 | 187 | player = Frog() | ||
1858 | 188 | |||
1859 | 189 | #Create the cars that travel in the left direction. | ||
1860 | 190 | leftcars = [ | ||
1861 | 191 | Leftcar(0, 285), | ||
1862 | 192 | Leftcar(280, 285), | ||
1863 | 193 | Leftcar(560, 285), | ||
1864 | 194 | Leftcar(100, 375), | ||
1865 | 195 | Leftcar(380, 375), | ||
1866 | 196 | Leftcar(660, 375), | ||
1867 | 197 | ] | ||
1868 | 198 | #Create the cars that travel right direction. | ||
1869 | 199 | rightcars = [ | ||
1870 | 200 | Rightcar(200, 330), | ||
1871 | 201 | Rightcar(480, 330), | ||
1872 | 202 | Rightcar(760, 330), | ||
1873 | 203 | Rightcar(60, 420), | ||
1874 | 204 | Rightcar(300, 420), | ||
1875 | 205 | Rightcar(580, 420), | ||
1876 | 206 | ] | ||
1877 | 207 | #Create babyfrogs | ||
1878 | 208 | babyfrogs = [ | ||
1879 | 209 | Homefrog(30, 15), | ||
1880 | 210 | Homefrog(258,15), | ||
1881 | 211 | Homefrog(482,15), | ||
1882 | 212 | Homefrog(720,15), | ||
1883 | 213 | ] | ||
1884 | 214 | #Create logs that travel left. | ||
1885 | 215 | leftlogs = [ | ||
1886 | 216 | Log(0, 60), | ||
1887 | 217 | Log(234, 60), | ||
1888 | 218 | Log(468, 60), | ||
1889 | 219 | Log(702, 60), | ||
1890 | 220 | Log(0, 150), | ||
1891 | 221 | Log(234, 150), | ||
1892 | 222 | Log(468, 150), | ||
1893 | 223 | Log(702, 150), | ||
1894 | 224 | ] | ||
1895 | 225 | #Create logs that travel right. | ||
1896 | 226 | rightlogs = [ | ||
1897 | 227 | Log(0, 105), | ||
1898 | 228 | Log(234, 105), | ||
1899 | 229 | Log(468, 105), | ||
1900 | 230 | Log(702, 105), | ||
1901 | 231 | Log(0, 195), | ||
1902 | 232 | Log(234, 195), | ||
1903 | 233 | Log(468, 195), | ||
1904 | 234 | Log(702, 195), | ||
1905 | 235 | ] | ||
1906 | 236 | #Create life images. | ||
1907 | 237 | lives = [ | ||
1908 | 238 | Life(10, 570), | ||
1909 | 239 | Life(38, 570), | ||
1910 | 240 | Life(66, 570), | ||
1911 | 241 | ] | ||
1912 | 242 | |||
1913 | 243 | #Create sprite group - all. | ||
1914 | 244 | #Using pygame.sprite.OirderedUpdates instead of RenderedUpdates | ||
1915 | 245 | #There is a small performance decrease for using this, but required | ||
1916 | 246 | #to allow frogs to be on top of logs. | ||
1917 | 247 | all = pygame.sprite.OrderedUpdates( | ||
1918 | 248 | leftlogs, rightlogs, player, leftcars, rightcars, babyfrogs, lives) | ||
1919 | 249 | |||
1920 | 250 | #Print level, and score/information on screen. | ||
1921 | 251 | font_write("Level: " +str(level) + " ", 34, True, (0, 0, 255), (0, 0, 0), (3, 510), screen) | ||
1922 | 252 | print_score_data(player.score, player.perfect_score, player.good_score) | ||
1923 | 253 | |||
1924 | 254 | pygame.key.set_repeat(100) | ||
1925 | 255 | #Main loop: (GAME LOOP). | ||
1926 | 256 | while 1: | ||
1927 | 257 | |||
1928 | 258 | #Get input | ||
1929 | 259 | for event in pygame.event.get(): | ||
1930 | 260 | if event.type == QUIT or (event.type == KEYDOWN and event.key == K_ESCAPE): | ||
1931 | 261 | sys.exit() | ||
1932 | 262 | #Only allow player movement if game is not over - not tech required: | ||
1933 | 263 | #as when its game over a new screen is displayed. | ||
1934 | 264 | #For each movement - reset on_left_log and on_right_log to False | ||
1935 | 265 | #so that there is never a way you could have some ghost movement of the player. | ||
1936 | 266 | if player.game_over != True: | ||
1937 | 267 | if event.type == KEYDOWN and event.key == K_UP: | ||
1938 | 268 | player.rect.top -= 45 | ||
1939 | 269 | player.on_left_log = False | ||
1940 | 270 | player.on_right_log = False | ||
1941 | 271 | for frog in babyfrogs: | ||
1942 | 272 | if frog.rect.colliderect(player.rect) and player.collecting ==True: | ||
1943 | 273 | player.rect.top +=45 | ||
1944 | 274 | if event.type == KEYDOWN and event.key == K_DOWN: | ||
1945 | 275 | player.rect.top += 45 | ||
1946 | 276 | player.on_left_log = False | ||
1947 | 277 | player.on_right_log = False | ||
1948 | 278 | for frog in babyfrogs: | ||
1949 | 279 | if frog.rect.colliderect(player.rect) and player.collecting ==True: | ||
1950 | 280 | player.rect.top -=45 | ||
1951 | 281 | if event.type == KEYDOWN and event.key == K_LEFT: | ||
1952 | 282 | player.rect.left -= 20 | ||
1953 | 283 | player.on_left_log = False | ||
1954 | 284 | player.on_right_log = False | ||
1955 | 285 | for frog in babyfrogs: | ||
1956 | 286 | if frog.rect.colliderect(player.rect) and player.collecting ==True: | ||
1957 | 287 | player.rect.left +=20 | ||
1958 | 288 | if event.type == KEYDOWN and event.key == K_RIGHT: | ||
1959 | 289 | player.rect.left += 20 | ||
1960 | 290 | player.on_left_log = False | ||
1961 | 291 | player.on_right_log = False | ||
1962 | 292 | for frog in babyfrogs: | ||
1963 | 293 | if frog.rect.colliderect(player.rect) and player.collecting ==True: | ||
1964 | 294 | player.rect.left -=20 | ||
1965 | 295 | |||
1966 | 296 | #move objects | ||
1967 | 297 | |||
1968 | 298 | #Move the left cars: | ||
1969 | 299 | for car in leftcars: | ||
1970 | 300 | if car.rect.right <=0: | ||
1971 | 301 | car.rect.left = 800 | ||
1972 | 302 | else: | ||
1973 | 303 | car.rect.left -= speed | ||
1974 | 304 | #Die if they collide | ||
1975 | 305 | if car.rect.colliderect(player.rect): | ||
1976 | 306 | player_died(player, babyfrogs) | ||
1977 | 307 | print_score_data(player.score, player.perfect_score, player.good_score) | ||
1978 | 308 | |||
1979 | 309 | #Move the right cars: | ||
1980 | 310 | for car in rightcars: | ||
1981 | 311 | if car.rect.left >=800: | ||
1982 | 312 | car.rect.right = 0 | ||
1983 | 313 | else: | ||
1984 | 314 | car.rect.left += speed | ||
1985 | 315 | #player dies if they collide | ||
1986 | 316 | if car.rect.colliderect(player.rect): | ||
1987 | 317 | player_died(player, babyfrogs) | ||
1988 | 318 | print_score_data(player.score, player.perfect_score, player.good_score) | ||
1989 | 319 | |||
1990 | 320 | #Move the left logs: | ||
1991 | 321 | for log in leftlogs: | ||
1992 | 322 | if log.rect.right <=0: | ||
1993 | 323 | log.rect.left = 800 | ||
1994 | 324 | else: | ||
1995 | 325 | log.rect.left -=speed | ||
1996 | 326 | #if log collides, set player variable on_left_log to True. | ||
1997 | 327 | if log.rect.colliderect(player.rect): | ||
1998 | 328 | player.on_left_log = True | ||
1999 | 329 | |||
2000 | 330 | #Move the right logs: | ||
2001 | 331 | for log in rightlogs: | ||
2002 | 332 | if log.rect.left >=800: | ||
2003 | 333 | log.rect.right = 0 | ||
2004 | 334 | else: | ||
2005 | 335 | log.rect.left +=speed | ||
2006 | 336 | #If right logs collides with frog, set player variable on_right_log to True. | ||
2007 | 337 | if log.rect.colliderect(player.rect): | ||
2008 | 338 | player.on_right_log = True | ||
2009 | 339 | |||
2010 | 340 | #Check if the player picks up a frog: | ||
2011 | 341 | #Set player variables: collecting to True, and collecting_number to babyfrog picked up. | ||
2012 | 342 | #Hide the frog from view. | ||
2013 | 343 | for frog in range(len(babyfrogs)): | ||
2014 | 344 | if babyfrogs[frog].rect.colliderect(player.rect): | ||
2015 | 345 | if player.collecting == False: | ||
2016 | 346 | player.collecting = True | ||
2017 | 347 | player.collecting_number = frog | ||
2018 | 348 | babyfrogs[frog].collected = True | ||
2019 | 349 | babyfrogs[frog].rect.left = -100 | ||
2020 | 350 | babyfrogs[frog].rect.top = -100 | ||
2021 | 351 | player.carry_frog(player.rect.left, player.rect.top) | ||
2022 | 352 | |||
2023 | 353 | #Water Area: if the frog is in between these positions | ||
2024 | 354 | #the frog must be on a log to survive. | ||
2025 | 355 | #if frog is on a log, then the system needs to automate the movement. | ||
2026 | 356 | if player.rect.top <=195 and player.rect.top >=40: | ||
2027 | 357 | if player.on_left_log == True: | ||
2028 | 358 | player.rect.left -=speed | ||
2029 | 359 | elif player.on_right_log == True: | ||
2030 | 360 | player.rect.left +=speed | ||
2031 | 361 | #Not on a log: die and update. | ||
2032 | 362 | else: | ||
2033 | 363 | player_died(player, babyfrogs) | ||
2034 | 364 | print_score_data(player.score, player.perfect_score, player.good_score) | ||
2035 | 365 | |||
2036 | 366 | #When its game over - display a game over screen. | ||
2037 | 367 | if player.game_over: | ||
2038 | 368 | game_over_screen(player.score) | ||
2039 | 369 | |||
2040 | 370 | #Handle the positioning of life icons. | ||
2041 | 371 | if player.lives == 2: | ||
2042 | 372 | lives[2].rect.left = -50 | ||
2043 | 373 | if player.lives == 1: | ||
2044 | 374 | lives[1].rect.left = -50 | ||
2045 | 375 | |||
2046 | 376 | #If all babyfrogs are saved, then start a new level :) | ||
2047 | 377 | if babyfrogs[0].saved == True: | ||
2048 | 378 | if babyfrogs[1].saved == True: | ||
2049 | 379 | if babyfrogs[2].saved == True: | ||
2050 | 380 | if babyfrogs[3].saved == True: | ||
2051 | 381 | new_level(player, babyfrogs, lives) | ||
2052 | 382 | |||
2053 | 383 | |||
2054 | 384 | #Clear sprite | ||
2055 | 385 | all.clear(screen, background) | ||
2056 | 386 | |||
2057 | 387 | #Update sprites | ||
2058 | 388 | all.update() | ||
2059 | 389 | player_boundaries(player, babyfrogs) | ||
2060 | 390 | |||
2061 | 391 | #Redraw sprites | ||
2062 | 392 | all.draw(screen) | ||
2063 | 393 | pygame.display.flip() | ||
2064 | 394 | |||
2065 | 395 | #Maintain frame rate | ||
2066 | 396 | #using 30 FPS | ||
2067 | 397 | clock.tick(30) | ||
2068 | 398 | |||
2069 | 399 | def print_score_data(score, perfect, good, time=None): | ||
2070 | 400 | """This method is used to print Score details to the screen. | ||
2071 | 401 | It prints score and the current score modifier. | ||
2072 | 402 | :param score: The players score | ||
2073 | 403 | :param type: ``int`` | ||
2074 | 404 | :param perfect: value of players perfectScore | ||
2075 | 405 | :param type: ``boolean`` | ||
2076 | 406 | :param good: value of players goodScore | ||
2077 | 407 | :param type: ``boolean`` | ||
2078 | 408 | :param time: time taken to score | ||
2079 | 409 | :param type: ``int`` | ||
2080 | 410 | """ | ||
2081 | 411 | #Print to screen. | ||
2082 | 412 | font_write("Score: " +str(score) + " ", 28, True, (0, 0, 255), (0, 0, 0), (3, 540), screen) | ||
2083 | 413 | if perfect: | ||
2084 | 414 | font_write("Score Modifier: x3 ", 28, True, (0, 0, 255), (0, 0, 0), (535, 510), screen) | ||
2085 | 415 | elif good: | ||
2086 | 416 | font_write("Score Modifier: x2 ", 28, True, (0, 0, 255), (0, 0, 0), (535, 510), screen) | ||
2087 | 417 | else: | ||
2088 | 418 | font_write("Score Modifier: x1 ", 28, True, (0, 0, 255), (0, 0, 0), (535, 510), screen) | ||
2089 | 419 | if time!=None: | ||
2090 | 420 | font_write( | ||
2091 | 421 | "Last Frog saved in: " +str(time) + " seconds! ", 28, True, (0, 0, 255), | ||
2092 | 422 | (0, 0, 0), (380, 550), screen) | ||
2093 | 423 | |||
2094 | 424 | def player_died(player, babyfrogs): | ||
2095 | 425 | """This method should be called if when the player died and acts out everything that is | ||
2096 | 426 | required to happen when a player dies: loosing of lives, ensuring babyfrog goes back correctly | ||
2097 | 427 | and so on. | ||
2098 | 428 | :param player: The player | ||
2099 | 429 | :param type: ``Frog`` - send through an instance of Frog Class. | ||
2100 | 430 | :param babyfrogs: The babyfrogs | ||
2101 | 431 | :param type: ``Homefrog`` - send through an instance of Homefrog Class. | ||
2102 | 432 | """ | ||
2103 | 433 | #Reset timer | ||
2104 | 434 | player.startTime = time.time() | ||
2105 | 435 | #if we die, then the frog we hold needs to be reset. | ||
2106 | 436 | babyfrog_reset(babyfrogs, player.collecting_number) | ||
2107 | 437 | #Reset some player variables. | ||
2108 | 438 | player.good_score = False | ||
2109 | 439 | player.perfect_score = False | ||
2110 | 440 | player.on_left_log = False | ||
2111 | 441 | player.on_right_log = False | ||
2112 | 442 | player.collecting = False | ||
2113 | 443 | player.collecting_number = None | ||
2114 | 444 | player.not_carry_frog(player.rect.left, player.rect.top) | ||
2115 | 445 | #Reset player position. | ||
2116 | 446 | player.rect.left = player.starting_left | ||
2117 | 447 | player.rect.top = player.starting_top | ||
2118 | 448 | #Remove one from life. | ||
2119 | 449 | player.lives -= 1 | ||
2120 | 450 | if player.lives <= 0: | ||
2121 | 451 | player.game_over = True | ||
2122 | 452 | |||
2123 | 453 | def player_boundaries(player, babyfrogs): | ||
2124 | 454 | """This method should be called when you want to ensure frog is within boundaries | ||
2125 | 455 | :param player: The player. | ||
2126 | 456 | :param type: ``Frog`` - send through an instance of Frog Class | ||
2127 | 457 | :param babyfrogs: The babyfrogs. | ||
2128 | 458 | :param type: ``Homefrog`` - send through an instance of Homefrog Class | ||
2129 | 459 | """ | ||
2130 | 460 | #If not on any logs: | ||
2131 | 461 | if player.on_left_log != True and player.on_right_log != True: | ||
2132 | 462 | if player.rect.top >=510: | ||
2133 | 463 | player.rect.top -=45 | ||
2134 | 464 | if player.rect.top <=0: | ||
2135 | 465 | player.rect.top +=45 | ||
2136 | 466 | if player.rect.left <=0: | ||
2137 | 467 | player.rect.left +=20 | ||
2138 | 468 | if player.rect.right >=800: | ||
2139 | 469 | player.rect.left -=20 | ||
2140 | 470 | #this is home spot - so check if we should score. | ||
2141 | 471 | if player.rect.top ==465: | ||
2142 | 472 | player_scored(player, babyfrogs) | ||
2143 | 473 | #If were on a log boundaries and handled differently. | ||
2144 | 474 | else: | ||
2145 | 475 | if player.rect.right <=0: | ||
2146 | 476 | player_died(player, babyfrogs) | ||
2147 | 477 | if player.rect.left >=800: | ||
2148 | 478 | player_died(player, babyfrogs) | ||
2149 | 479 | |||
2150 | 480 | def babyfrog_reset(babyfrog, collecting_number): | ||
2151 | 481 | """ This method should be called when you want to reset the position of the babyfrog specified | ||
2152 | 482 | it sets the saved variable of a babyfrog in the list to true, the frog that is reset depends | ||
2153 | 483 | on what is send through. | ||
2154 | 484 | :param babyfrogs: The babyfrogs. | ||
2155 | 485 | :param type: ``Homefrog`` - send through an instance of Homefrog Class | ||
2156 | 486 | :param collecting_number: The babyfrog you want to reset. | ||
2157 | 487 | :param type: ``int`` | ||
2158 | 488 | """ | ||
2159 | 489 | #Make sure the frog we are trying to reset has a number (error prevention) | ||
2160 | 490 | #Use the default left, top that were assigned on creation to reset position | ||
2161 | 491 | if collecting_number!=None: | ||
2162 | 492 | #babyfrog[collecting_number].rect.left = babyfrog[collecting_number].left | ||
2163 | 493 | #babyfrog[collecting_number].rect.top = babyfrog[collecting_number].top | ||
2164 | 494 | #now just sets saved to true, so frog can no longer be captured.It dies with big frog. | ||
2165 | 495 | babyfrog[collecting_number].saved = True | ||
2166 | 496 | def player_scored(player, babyfrogs): | ||
2167 | 497 | """ This method should be called when the player has scored. | ||
2168 | 498 | It acts out things required when a player scores. | ||
2169 | 499 | :param player: The player. | ||
2170 | 500 | :param type: ``Frog`` - send through an instance of Frog Class | ||
2171 | 501 | :param babyfrogs: The babyfrogs. | ||
2172 | 502 | :param type: ``Homefrog`` - send through an instance of Homefrog Class | ||
2173 | 503 | """ | ||
2174 | 504 | #Since we can start at the scoring position, we only want to act out this | ||
2175 | 505 | #if we are collecting a frog, (and as error prevention so we cannot attempt to score when | ||
2176 | 506 | #list is "None" make sure there is a value in collecting_number. | ||
2177 | 507 | #Reset player variables: collecting, collecting_number | ||
2178 | 508 | #Set babyfrogs variables: saved - True (we've just saved frog) | ||
2179 | 509 | #Add score and print. | ||
2180 | 510 | if player.collecting == True and player.collecting_number !=None: | ||
2181 | 511 | player.collecting = False | ||
2182 | 512 | babyfrogs[player.collecting_number].saved = True | ||
2183 | 513 | babyfrogs[player.collecting_number].collected = False | ||
2184 | 514 | player.collecting_number = None | ||
2185 | 515 | player.not_carry_frog(player.rect.left, player.rect.top) | ||
2186 | 516 | player.add_score() | ||
2187 | 517 | print_score_data(player.score, player.perfect_score, player.good_score, player.end_time) | ||
2188 | 518 | |||
2189 | 519 | def new_level(player, babyfrogs, lives): | ||
2190 | 520 | """ This method should be called when you want a new level to begin. | ||
2191 | 521 | It resets the game so that a new level can begin - and then increments level and speed. | ||
2192 | 522 | :param player: The player | ||
2193 | 523 | :param type: ``Frog`` - send through an instance of Frog Class. | ||
2194 | 524 | :param babyfrogs: The babyfrogs | ||
2195 | 525 | :param type: ``Homefrog`` - send through an instance of Homefrog Class. | ||
2196 | 526 | """ | ||
2197 | 527 | global level, speed | ||
2198 | 528 | level +=1 #add 1 to level | ||
2199 | 529 | speed +=1 #add 1 to speed | ||
2200 | 530 | #Reset position of frog. | ||
2201 | 531 | player.rect.left = player.starting_left | ||
2202 | 532 | player.rect.top = player.starting_top | ||
2203 | 533 | #Reset position of babyfrogs, and reset collected, saved variables. | ||
2204 | 534 | for frog in babyfrogs: | ||
2205 | 535 | frog.collected = False | ||
2206 | 536 | frog.saved = False | ||
2207 | 537 | frog.rect.left = frog.left | ||
2208 | 538 | frog.rect.top = frog.top | ||
2209 | 539 | #Before we add lives check if we have 3: Remember if you have three lives when you complete | ||
2210 | 540 | #a level you get a good_score = true. | ||
2211 | 541 | if player.lives ==3: | ||
2212 | 542 | player.good_score = True | ||
2213 | 543 | else: | ||
2214 | 544 | player_add_life(player, lives) | ||
2215 | 545 | #reprint stuff to screen. | ||
2216 | 546 | font_write("Level: " +str(level) + " ", 34, True, (0, 0, 255), (0, 0, 0), (3, 510), screen) | ||
2217 | 547 | print_score_data(player.score, player.perfect_score, player.good_score, player.end_time) | ||
2218 | 548 | |||
2219 | 549 | def player_add_life(player, lives): | ||
2220 | 550 | """ This method to be called when you wish to add a life to the player. | ||
2221 | 551 | Handles the life images and so forth. | ||
2222 | 552 | """ | ||
2223 | 553 | #revalidates that player doesn't already have 3 lifes: 3 is max. | ||
2224 | 554 | if player.lives <3: | ||
2225 | 555 | player.lives +=1 | ||
2226 | 556 | if player.lives==3: | ||
2227 | 557 | lives[2].rect.left = 68 | ||
2228 | 558 | if player.lives==2: | ||
2229 | 559 | lives[1].rect.left = 38 | ||
2230 | 560 | |||
2231 | 561 | if __name__ == '__main__': main() | ||
2232 | 0 | 562 | ||
2233 | === removed file 'Frogger/frogger.py' | |||
2234 | --- Frogger/frogger.py 2010-02-09 19:44:03 +0000 | |||
2235 | +++ Frogger/frogger.py 1970-01-01 00:00:00 +0000 | |||
2236 | @@ -1,356 +0,0 @@ | |||
2237 | 1 | #!/usr/bin/env python | ||
2238 | 2 | """ | ||
2239 | 3 | Frog Game (C) Daniel Bell, 2010. | ||
2240 | 4 | Frog Game is released under the General Public License Version 3. See LICENSE for details. | ||
2241 | 5 | Frog Game is a fun survival game, that is based upon the classic arcade game: Frogger. | ||
2242 | 6 | """ | ||
2243 | 7 | try: | ||
2244 | 8 | import sys | ||
2245 | 9 | import os | ||
2246 | 10 | import pygame | ||
2247 | 11 | import time | ||
2248 | 12 | from pygame.locals import * | ||
2249 | 13 | from sprites import * | ||
2250 | 14 | except ImportError, err: | ||
2251 | 15 | print "Failure loading module. %s" % (err) | ||
2252 | 16 | sys.exit(2) | ||
2253 | 17 | |||
2254 | 18 | """ | ||
2255 | 19 | Image Loading Function | ||
2256 | 20 | """ | ||
2257 | 21 | global screen | ||
2258 | 22 | screen = pygame.display.set_mode((592,774), DOUBLEBUF, 32) | ||
2259 | 23 | |||
2260 | 24 | def levelIndicator(level): | ||
2261 | 25 | fontNormal = pygame.font.Font('data/fonts/bgrovealtb.ttf', 28) | ||
2262 | 26 | levelText = fontNormal.render("Level: " + str(level), True, (0, 0, 255), (181, 230, 29)) | ||
2263 | 27 | screen.blit(levelText, (250, 15)) | ||
2264 | 28 | pygame.display.update() | ||
2265 | 29 | |||
2266 | 30 | def scoreIndicator(score, time, perfect, good): | ||
2267 | 31 | fontNormal = pygame.font.Font('data/fonts/bgrovealtb.ttf', 18) | ||
2268 | 32 | scoreText = fontNormal.render("Score: " + str(score), True, (0, 0, 255), (0, 0, 0)) | ||
2269 | 33 | if time != 0: | ||
2270 | 34 | scoreTime = fontNormal.render("Last Frog Scored in: " + str(time) + " seconds!", True, (0, 0, 255), (0, 0, 0)) | ||
2271 | 35 | screen.blit(scoreTime, (300, 745)) | ||
2272 | 36 | |||
2273 | 37 | if perfect == True: | ||
2274 | 38 | modifier = fontNormal.render("Score Modifier: (x3)", True, (0, 0, 255), (0, 0, 0)) | ||
2275 | 39 | screen.blit(modifier, (422, 715)) | ||
2276 | 40 | |||
2277 | 41 | elif good == True and perfect == False: | ||
2278 | 42 | modifier = fontNormal.render("Score Modifier: (x2)", True, (0, 0, 255), (0, 0, 0)) | ||
2279 | 43 | screen.blit(modifier, (422, 715)) | ||
2280 | 44 | |||
2281 | 45 | else: | ||
2282 | 46 | modifier = fontNormal.render("Score Modifier: (x1)", True, (0, 0, 255), (0, 0, 0)) | ||
2283 | 47 | screen.blit(modifier, (422, 715)) | ||
2284 | 48 | |||
2285 | 49 | screen.blit(scoreText, (5, 745)) | ||
2286 | 50 | pygame.display.update() | ||
2287 | 51 | |||
2288 | 52 | def gameOverScreen(score, level): | ||
2289 | 53 | pygame.init() | ||
2290 | 54 | pygame.display.set_caption('Frog Game') | ||
2291 | 55 | logo = pygame.image.load("data/images/logo.png") | ||
2292 | 56 | pygame.display.set_icon(logo) | ||
2293 | 57 | |||
2294 | 58 | screen = pygame.display.set_mode((592,774), DOUBLEBUF, 32) | ||
2295 | 59 | |||
2296 | 60 | pygame.display.update() | ||
2297 | 61 | |||
2298 | 62 | """ | ||
2299 | 63 | Menu | ||
2300 | 64 | """ | ||
2301 | 65 | fontTitle = pygame.font.Font('data/fonts/bgrovealtb.ttf', 72) | ||
2302 | 66 | fontNormal = pygame.font.Font('data/fonts/bgrovealtb.ttf', 28) | ||
2303 | 67 | fontExit = pygame.font.Font('data/fonts/bgrovealtb.ttf', 18) | ||
2304 | 68 | |||
2305 | 69 | title = fontTitle.render("GAME OVER", True, (0, 0, 255)) | ||
2306 | 70 | caption = fontNormal.render("You Scored: " + str(score), True, (0, 0, 255)) | ||
2307 | 71 | caption2 = fontNormal.render("Level: " + str(level), True, (0, 0, 255)) | ||
2308 | 72 | play = fontNormal.render("Press <SPACE> to Start a New Game", True, (0, 0, 255)) | ||
2309 | 73 | esc = fontExit.render("ESC to exit", True, (0, 0, 255)) | ||
2310 | 74 | |||
2311 | 75 | screen.blit(caption, (150, 160)) | ||
2312 | 76 | screen.blit(caption2, (150, 200)) | ||
2313 | 77 | screen.blit(title, (100,50)) | ||
2314 | 78 | screen.blit(esc, (0, 0)) | ||
2315 | 79 | screen.blit(play, (60, 700)) | ||
2316 | 80 | pygame.display.update() | ||
2317 | 81 | clock = pygame.time.Clock() | ||
2318 | 82 | while 1: | ||
2319 | 83 | |||
2320 | 84 | #Get input | ||
2321 | 85 | for event in pygame.event.get(): | ||
2322 | 86 | if event.type == QUIT or (event.type == KEYDOWN and event.key == K_ESCAPE): | ||
2323 | 87 | sys.exit() | ||
2324 | 88 | if event.type == KEYDOWN and event.key == K_SPACE: | ||
2325 | 89 | game() | ||
2326 | 90 | #using 30 FPS | ||
2327 | 91 | clock.tick(30) | ||
2328 | 92 | def main(): | ||
2329 | 93 | pygame.init() | ||
2330 | 94 | pygame.display.set_caption('Frog Game') | ||
2331 | 95 | logo = pygame.image.load("data/images/logo.png") | ||
2332 | 96 | pygame.display.set_icon(logo) | ||
2333 | 97 | |||
2334 | 98 | screen = pygame.display.set_mode((592,774), DOUBLEBUF, 32) | ||
2335 | 99 | |||
2336 | 100 | pygame.display.update() | ||
2337 | 101 | |||
2338 | 102 | """ | ||
2339 | 103 | Menu | ||
2340 | 104 | """ | ||
2341 | 105 | fontTitle = pygame.font.Font('data/fonts/bgrovealtb.ttf', 72) | ||
2342 | 106 | fontNormal = pygame.font.Font('data/fonts/bgrovealtb.ttf', 28) | ||
2343 | 107 | fontExit = pygame.font.Font('data/fonts/bgrovealtb.ttf', 18) | ||
2344 | 108 | |||
2345 | 109 | title = fontTitle.render("FROG GAME", True, (0, 0, 255)) | ||
2346 | 110 | caption = fontNormal.render("Welcome To", True, (0, 0, 255)) | ||
2347 | 111 | play = fontNormal.render("Press <SPACE> to Continue", True, (0, 0, 255)) | ||
2348 | 112 | esc = fontExit.render("ESC to exit", True, (0, 0, 255)) | ||
2349 | 113 | |||
2350 | 114 | screen.blit(caption, (220, 175)) | ||
2351 | 115 | screen.blit(title, (100,200)) | ||
2352 | 116 | screen.blit(esc, (0, 0)) | ||
2353 | 117 | screen.blit(play, (120, 700)) | ||
2354 | 118 | pygame.display.update() | ||
2355 | 119 | |||
2356 | 120 | clock = pygame.time.Clock() | ||
2357 | 121 | while 1: | ||
2358 | 122 | |||
2359 | 123 | #Get input | ||
2360 | 124 | for event in pygame.event.get(): | ||
2361 | 125 | if event.type == QUIT or (event.type == KEYDOWN and event.key == K_ESCAPE): | ||
2362 | 126 | sys.exit() | ||
2363 | 127 | if event.type == KEYDOWN and event.key == K_SPACE: | ||
2364 | 128 | game() | ||
2365 | 129 | #using 30 FPS | ||
2366 | 130 | clock.tick(30) | ||
2367 | 131 | def game(): | ||
2368 | 132 | |||
2369 | 133 | #Initialise pygame, icons and captions. | ||
2370 | 134 | pygame.init() | ||
2371 | 135 | pygame.display.set_caption('Frog Game') | ||
2372 | 136 | logo = pygame.image.load("data/images/logo.png") | ||
2373 | 137 | pygame.display.set_icon(logo) | ||
2374 | 138 | |||
2375 | 139 | #Initialise the screen, resolution: 592x774 (which is the size of the current background). | ||
2376 | 140 | #TODO: Make the screen size smaller by default, or allow scrolling to occur in the game. | ||
2377 | 141 | |||
2378 | 142 | screen = pygame.display.set_mode((592,774), DOUBLEBUF, 32) | ||
2379 | 143 | |||
2380 | 144 | #Make background | ||
2381 | 145 | backgroundImage = 'data/images/background.png' | ||
2382 | 146 | background = pygame.image.load(backgroundImage).convert() | ||
2383 | 147 | screen.blit(background, (0,0)) | ||
2384 | 148 | pygame.display.update() | ||
2385 | 149 | |||
2386 | 150 | |||
2387 | 151 | #Keep track of sprites | ||
2388 | 152 | player = Frog() | ||
2389 | 153 | leftcars = [] | ||
2390 | 154 | """ | ||
2391 | 155 | 0 & 1 = Row 1, 2 & 3 = Row 3, 4 & 5 = Row 5 | ||
2392 | 156 | """ | ||
2393 | 157 | leftcars.append(Leftcar(400, 616)) # 0 | ||
2394 | 158 | leftcars.append(Leftcar(100, 616)) # 1 | ||
2395 | 159 | leftcars.append(Leftcar(400, 526)) # 2 | ||
2396 | 160 | leftcars.append(Leftcar(100, 526)) # 3 | ||
2397 | 161 | leftcars.append(Leftcar(400, 436)) # 4 | ||
2398 | 162 | leftcars.append(Leftcar(100, 436)) # 5 | ||
2399 | 163 | |||
2400 | 164 | rightcars = [] | ||
2401 | 165 | """ | ||
2402 | 166 | 0 & 1 = Row 1, 2 & 3 = Row 3, 4 & 5 = Row 5 | ||
2403 | 167 | """ | ||
2404 | 168 | rightcars.append(Rightcar(200, 571)) # 0 | ||
2405 | 169 | rightcars.append(Rightcar(500, 571)) # 1 | ||
2406 | 170 | rightcars.append(Rightcar(200, 481)) # 2 | ||
2407 | 171 | rightcars.append(Rightcar(500, 481)) # 3 | ||
2408 | 172 | rightcars.append(Rightcar(200, 391)) # 4 | ||
2409 | 173 | rightcars.append(Rightcar(500, 391)) # 5 | ||
2410 | 174 | |||
2411 | 175 | homefrogs = [Homefrog(-10,-10), Homefrog(-10,-10), Homefrog(-10,-10), Homefrog(-10,-10), Homefrog(-10,-10)] | ||
2412 | 176 | |||
2413 | 177 | leftlogs = [Log(20, 301), Log(220, 301), Log(420,301), Log(20, 211), Log(220, 211), Log(420, 211), Log(20, 121), Log(220, 121), Log(420, 121)] | ||
2414 | 178 | rightlogs = [Log(-20, 256), Log(180, 256), Log(380, 256), Log(-20, 166), Log(180, 166), Log(380, 166)] | ||
2415 | 179 | |||
2416 | 180 | lives = [Life(10, 710), Life(38, 710), Life(66, 710)] | ||
2417 | 181 | |||
2418 | 182 | speed = 4 | ||
2419 | 183 | |||
2420 | 184 | """ | ||
2421 | 185 | Using pygame.sprite.OrderedUpdates instead of pygame.sprite.RenderedUpdates due to the need to have the the frog ONTOP of the logs. | ||
2422 | 186 | There is a small performance hit using this function. | ||
2423 | 187 | """ | ||
2424 | 188 | all = pygame.sprite.OrderedUpdates(leftlogs, rightlogs, player, leftcars, rightcars, homefrogs, lives) | ||
2425 | 189 | |||
2426 | 190 | #Keep track of time | ||
2427 | 191 | clock = pygame.time.Clock() | ||
2428 | 192 | |||
2429 | 193 | levelIndicator(player.level) | ||
2430 | 194 | scoreIndicator(player.score, 0, player.perfectScore, player.goodScore) | ||
2431 | 195 | #Game Loop | ||
2432 | 196 | while 1: | ||
2433 | 197 | |||
2434 | 198 | #Get input | ||
2435 | 199 | for event in pygame.event.get(): | ||
2436 | 200 | if event.type == QUIT or (event.type == KEYDOWN and event.key == K_ESCAPE): | ||
2437 | 201 | sys.exit() | ||
2438 | 202 | if player.gameOver != True: | ||
2439 | 203 | if event.type == KEYDOWN and event.key == K_UP: | ||
2440 | 204 | player.rect.top -= 45 | ||
2441 | 205 | player.onLeftLog = False | ||
2442 | 206 | player.onRightLog = False | ||
2443 | 207 | if event.type == KEYDOWN and event.key == K_DOWN: | ||
2444 | 208 | player.rect.top += 45 | ||
2445 | 209 | player.onLeftLog = False | ||
2446 | 210 | player.onRightLog = False | ||
2447 | 211 | if event.type == KEYDOWN and event.key == K_LEFT: | ||
2448 | 212 | player.rect.left -= 20 | ||
2449 | 213 | player.onLeftLog = False | ||
2450 | 214 | player.onRightLog = False | ||
2451 | 215 | if event.type == KEYDOWN and event.key == K_RIGHT: | ||
2452 | 216 | player.rect.left += 20 | ||
2453 | 217 | player.onLeftLog = False | ||
2454 | 218 | player.onRightLog = False | ||
2455 | 219 | |||
2456 | 220 | #move objects | ||
2457 | 221 | for car in leftcars: | ||
2458 | 222 | if car.rect.right <=0: | ||
2459 | 223 | car.rect.left = 600 | ||
2460 | 224 | else: | ||
2461 | 225 | car.rect.left -= speed | ||
2462 | 226 | if car.rect.colliderect(player.rect): | ||
2463 | 227 | player.loseLife() | ||
2464 | 228 | scoreIndicator(player.score, 0, player.perfectScore, player.goodScore) | ||
2465 | 229 | |||
2466 | 230 | for car in rightcars: | ||
2467 | 231 | if car.rect.left >=600: | ||
2468 | 232 | car.rect.right = 0 | ||
2469 | 233 | else: | ||
2470 | 234 | car.rect.left += speed | ||
2471 | 235 | if car.rect.colliderect(player.rect): | ||
2472 | 236 | player.loseLife() | ||
2473 | 237 | scoreIndicator(player.score, 0, player.perfectScore, player.goodScore) | ||
2474 | 238 | |||
2475 | 239 | for log in leftlogs: | ||
2476 | 240 | if log.rect.right <=0: | ||
2477 | 241 | log.rect.left = 600 | ||
2478 | 242 | else: | ||
2479 | 243 | log.rect.left -=speed | ||
2480 | 244 | if log.rect.colliderect(player.rect): | ||
2481 | 245 | player.onLeftLog = True | ||
2482 | 246 | |||
2483 | 247 | for log in rightlogs: | ||
2484 | 248 | if log.rect.left >=600: | ||
2485 | 249 | log.rect.right = 0 | ||
2486 | 250 | else: | ||
2487 | 251 | log.rect.left +=speed | ||
2488 | 252 | if log.rect.colliderect(player.rect): | ||
2489 | 253 | player.onRightLog = True | ||
2490 | 254 | |||
2491 | 255 | if player.rect.top <=301 and player.rect.top >=121: | ||
2492 | 256 | if player.onLeftLog == True: | ||
2493 | 257 | player.rect.left -=speed | ||
2494 | 258 | elif player.onRightLog == True: | ||
2495 | 259 | player.rect.left +=speed | ||
2496 | 260 | else: | ||
2497 | 261 | player.loseLife() | ||
2498 | 262 | scoreIndicator(player.score, 0, player.perfectScore, player.goodScore) | ||
2499 | 263 | |||
2500 | 264 | if player.rect.top <=100: | ||
2501 | 265 | |||
2502 | 266 | if player.rect.left >=12 and player.rect.right <=104 and player.frogsHome[0] != True: | ||
2503 | 267 | player.scored() | ||
2504 | 268 | scoreIndicator(player.score, player.endTime, player.perfectScore, player.goodScore) | ||
2505 | 269 | homefrogs[0].rect.left = 35 | ||
2506 | 270 | homefrogs[0].rect.top = 70 | ||
2507 | 271 | player.frogsHome[0] = True | ||
2508 | 272 | |||
2509 | 273 | elif player.rect.left >=132 and player.rect.right <=224 and player.frogsHome[1] != True: | ||
2510 | 274 | player.scored() | ||
2511 | 275 | scoreIndicator(player.score, player.endTime, player.perfectScore, player.goodScore) | ||
2512 | 276 | homefrogs[1].rect.left = 155 | ||
2513 | 277 | homefrogs[1].rect.top = 70 | ||
2514 | 278 | player.frogsHome[1] = True | ||
2515 | 279 | |||
2516 | 280 | elif player.rect.left >=252 and player.rect.right <=344 and player.frogsHome[2] != True: | ||
2517 | 281 | player.scored() | ||
2518 | 282 | scoreIndicator(player.score, player.endTime, player.perfectScore, player.goodScore) | ||
2519 | 283 | homefrogs[2].rect.left = 275 | ||
2520 | 284 | homefrogs[2].rect.top = 70 | ||
2521 | 285 | player.frogsHome[2] = True | ||
2522 | 286 | |||
2523 | 287 | elif player.rect.left >=372 and player.rect.right <=464 and player.frogsHome[3] != True: | ||
2524 | 288 | player.scored() | ||
2525 | 289 | scoreIndicator(player.score, player.endTime, player.perfectScore, player.goodScore) | ||
2526 | 290 | homefrogs[3].rect.left = 395 | ||
2527 | 291 | homefrogs[3].rect.top = 70 | ||
2528 | 292 | player.frogsHome[3] = True | ||
2529 | 293 | |||
2530 | 294 | elif player.rect.left >=492 and player.rect.right <=584 and player.frogsHome[4] != True: | ||
2531 | 295 | player.scored() | ||
2532 | 296 | scoreIndicator(player.score, player.endTime, player.perfectScore, player.goodScore) | ||
2533 | 297 | homefrogs[4].rect.left = 515 | ||
2534 | 298 | homefrogs[4].rect.top = 70 | ||
2535 | 299 | player.frogsHome[4] = True | ||
2536 | 300 | |||
2537 | 301 | else: | ||
2538 | 302 | player.loseLife() | ||
2539 | 303 | scoreIndicator(player.score, 0, player.perfectScore, player.goodScore) | ||
2540 | 304 | |||
2541 | 305 | if player.frogsHome[0] == True and player.frogsHome[1] == True and player.frogsHome[2] == True and player.frogsHome[3] == True and player.frogsHome[4] == True: | ||
2542 | 306 | player.frogsHome[0] = False | ||
2543 | 307 | player.frogsHome[1] = False | ||
2544 | 308 | player.frogsHome[2] = False | ||
2545 | 309 | player.frogsHome[3] = False | ||
2546 | 310 | player.frogsHome[4] = False | ||
2547 | 311 | homefrogs[0].rect.left = -10 | ||
2548 | 312 | homefrogs[0].rect.top = -10 | ||
2549 | 313 | homefrogs[1].rect.left = -10 | ||
2550 | 314 | homefrogs[1].rect.top = -10 | ||
2551 | 315 | homefrogs[2].rect.left = -10 | ||
2552 | 316 | homefrogs[2].rect.top = -10 | ||
2553 | 317 | homefrogs[3].rect.left = -10 | ||
2554 | 318 | homefrogs[3].rect.top = -10 | ||
2555 | 319 | homefrogs[4].rect.left = -10 | ||
2556 | 320 | homefrogs[4].rect.top = -10 | ||
2557 | 321 | if player.lives == 3: | ||
2558 | 322 | player.goodScore = True | ||
2559 | 323 | if player.lives <3: | ||
2560 | 324 | player.lives +=1 | ||
2561 | 325 | if player.lives == 2: | ||
2562 | 326 | lives[1].rect.left = 38 | ||
2563 | 327 | elif player.lives == 3: | ||
2564 | 328 | lives[2].rect.left = 66 | ||
2565 | 329 | player.level +=1 | ||
2566 | 330 | speed +=1 | ||
2567 | 331 | levelIndicator(player.level) | ||
2568 | 332 | |||
2569 | 333 | if player.gameOver: | ||
2570 | 334 | gameOverScreen(player.score, player.level) | ||
2571 | 335 | |||
2572 | 336 | if player.lives == 2: | ||
2573 | 337 | lives[2].rect.left = -50 | ||
2574 | 338 | if player.lives == 1: | ||
2575 | 339 | lives[1].rect.left = -50 | ||
2576 | 340 | |||
2577 | 341 | |||
2578 | 342 | #Clear sprite | ||
2579 | 343 | all.clear(screen, background) | ||
2580 | 344 | |||
2581 | 345 | #Update sprites | ||
2582 | 346 | all.update() | ||
2583 | 347 | |||
2584 | 348 | #Redraw sprites | ||
2585 | 349 | dirty = all.draw(screen) | ||
2586 | 350 | pygame.display.update(dirty) | ||
2587 | 351 | |||
2588 | 352 | #Maintain frame rate | ||
2589 | 353 | #using 30 FPS | ||
2590 | 354 | clock.tick(30) | ||
2591 | 355 | |||
2592 | 356 | if __name__ == '__main__': main() | ||
2593 | 357 | 0 | ||
2594 | === added directory 'Frogger/lib' | |||
2595 | === added file 'Frogger/lib/__init__.py' | |||
2596 | === added file 'Frogger/lib/engine.py' | |||
2597 | --- Frogger/lib/engine.py 1970-01-01 00:00:00 +0000 | |||
2598 | +++ Frogger/lib/engine.py 2010-03-12 10:44:17 +0000 | |||
2599 | @@ -0,0 +1,69 @@ | |||
2600 | 1 | #!/usr/bin/env python | ||
2601 | 2 | |||
2602 | 3 | ###BEGIN LICENSE | ||
2603 | 4 | # Copyright (C) 2010 Daniel Bell <daniel.bell@saraclan.com> | ||
2604 | 5 | # | ||
2605 | 6 | #This program is free software: you can redistribute it and/or modify it | ||
2606 | 7 | #under the terms of the GNU General Public License version 3, as published | ||
2607 | 8 | #by the Free Software Foundation. | ||
2608 | 9 | # | ||
2609 | 10 | #This program is distributed in the hope that it will be useful, but | ||
2610 | 11 | #WITHOUT ANY WARRANTY; without even the implied warranties of | ||
2611 | 12 | #MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR | ||
2612 | 13 | #PURPOSE. See the GNU General Public License for more details. | ||
2613 | 14 | # | ||
2614 | 15 | #You should have received a copy of the GNU General Public License along | ||
2615 | 16 | #with this program. If not, see <http://www.gnu.org/licenses/>. | ||
2616 | 17 | ### END LICENSE | ||
2617 | 18 | |||
2618 | 19 | |||
2619 | 20 | import os | ||
2620 | 21 | import pygame | ||
2621 | 22 | from pygame.locals import * | ||
2622 | 23 | |||
2623 | 24 | global font | ||
2624 | 25 | global font_write | ||
2625 | 26 | |||
2626 | 27 | def load_image(name, colorkey=None): | ||
2627 | 28 | fullname = os.path.join('data/images/', name) | ||
2628 | 29 | try: | ||
2629 | 30 | image = pygame.image.load(fullname) | ||
2630 | 31 | except pygame.error, message: | ||
2631 | 32 | print 'Cannot load image:', fullname | ||
2632 | 33 | raise SystemExit, message | ||
2633 | 34 | image = image.convert() | ||
2634 | 35 | if colorkey is not None: | ||
2635 | 36 | if colorkey is -1: | ||
2636 | 37 | colorkey = image.get_at((0,0)) | ||
2637 | 38 | image.set_colorkey(colorkey, RLEACCEL) | ||
2638 | 39 | return image, image.get_rect() | ||
2639 | 40 | |||
2640 | 41 | def font_write(message, size, aaliasing, color, background, coordinates, screen): | ||
2641 | 42 | """ This Method is used to print messages to the screen. | ||
2642 | 43 | You can call this method, and with parameters messages will be displayed on the screen. | ||
2643 | 44 | |||
2644 | 45 | :param message: The message you wish to display on the screen. | ||
2645 | 46 | :type message: ``String`` | ||
2646 | 47 | :param size: The size of font you wish to use. | ||
2647 | 48 | :type size: ``int`` | ||
2648 | 49 | :param aaliasing: Whether or not anti-aliasing should be enabled. | ||
2649 | 50 | :type aaliasing: ``boolean`` | ||
2650 | 51 | :param color: Color of the message | ||
2651 | 52 | :type color: ``int`` - in format of (red, green, blue) | ||
2652 | 53 | :param background: Color of background. | ||
2653 | 54 | :type background: ``int`` - 0 results in transparent otherwise format (red, green, blue) | ||
2654 | 55 | :param coordinates: Coordinates of where the message should be displayed. | ||
2655 | 56 | :param type: ``int`` - format (x, y) | ||
2656 | 57 | :param screen: The screen you wish to print on | ||
2657 | 58 | :param type: ``pygame.display`` | ||
2658 | 59 | """ | ||
2659 | 60 | #Define font | ||
2660 | 61 | font ='data/fonts/nibby.ttf' | ||
2661 | 62 | font = pygame.font.Font(font, size) | ||
2662 | 63 | #Check if background is defined or not. | ||
2663 | 64 | if background==0: | ||
2664 | 65 | print_message=font.render(message, aaliasing, color) | ||
2665 | 66 | else: | ||
2666 | 67 | print_message=font.render(message, aaliasing, color, background) | ||
2667 | 68 | screen.blit(print_message, coordinates) | ||
2668 | 69 | #pygame.display.update() | ||
2669 | 0 | 70 | ||
2670 | === added file 'Frogger/lib/sprites.py' | |||
2671 | --- Frogger/lib/sprites.py 1970-01-01 00:00:00 +0000 | |||
2672 | +++ Frogger/lib/sprites.py 2010-03-12 10:44:17 +0000 | |||
2673 | @@ -0,0 +1,136 @@ | |||
2674 | 1 | #!/usr/bin/env python | ||
2675 | 2 | |||
2676 | 3 | ###BEGIN LICENSE | ||
2677 | 4 | # Copyright (C) 2010 Daniel Bell <daniel.bell@saraclan.com> | ||
2678 | 5 | # | ||
2679 | 6 | #This program is free software: you can redistribute it and/or modify it | ||
2680 | 7 | #under the terms of the GNU General Public License version 3, as published | ||
2681 | 8 | #by the Free Software Foundation. | ||
2682 | 9 | # | ||
2683 | 10 | #This program is distributed in the hope that it will be useful, but | ||
2684 | 11 | #WITHOUT ANY WARRANTY; without even the implied warranties of | ||
2685 | 12 | #MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR | ||
2686 | 13 | #PURPOSE. See the GNU General Public License for more details. | ||
2687 | 14 | # | ||
2688 | 15 | #You should have received a copy of the GNU General Public License along | ||
2689 | 16 | #with this program. If not, see <http://www.gnu.org/licenses/>. | ||
2690 | 17 | ### END LICENSE | ||
2691 | 18 | |||
2692 | 19 | #Sprite module: Contains all the sprites/objects. | ||
2693 | 20 | |||
2694 | 21 | |||
2695 | 22 | import sys | ||
2696 | 23 | import os | ||
2697 | 24 | import pygame | ||
2698 | 25 | import time | ||
2699 | 26 | |||
2700 | 27 | from pygame.locals import * | ||
2701 | 28 | from lib.engine import * | ||
2702 | 29 | |||
2703 | 30 | class Leftcar(pygame.sprite.Sprite): | ||
2704 | 31 | """ This is the Leftcar class - contains logic required for | ||
2705 | 32 | anything related to the leftcar. | ||
2706 | 33 | Leftcar is a subclass of pygame.sprite.Sprite | ||
2707 | 34 | """ | ||
2708 | 35 | def __init__(self, left, top): | ||
2709 | 36 | pygame.sprite.Sprite.__init__(self) | ||
2710 | 37 | self.image, self.rect = load_image('bettercar2.gif', -1) | ||
2711 | 38 | self.rect.left = left | ||
2712 | 39 | self.rect.top = top | ||
2713 | 40 | |||
2714 | 41 | class Rightcar(pygame.sprite.Sprite): | ||
2715 | 42 | """ This is the Rightcar class - contains logic required for | ||
2716 | 43 | anything related to the Rightcar. | ||
2717 | 44 | Rightcar is a subclass of pygame.sprite.Sprite | ||
2718 | 45 | """ | ||
2719 | 46 | def __init__(self, left, top): | ||
2720 | 47 | pygame.sprite.Sprite.__init__(self) | ||
2721 | 48 | self.image, self.rect = load_image('bettercar.gif', -1) | ||
2722 | 49 | self.rect.left = left | ||
2723 | 50 | self.rect.top = top | ||
2724 | 51 | |||
2725 | 52 | class Homefrog(pygame.sprite.Sprite): | ||
2726 | 53 | def __init__(self, left, top): | ||
2727 | 54 | self.left = left | ||
2728 | 55 | self.top = top | ||
2729 | 56 | pygame.sprite.Sprite.__init__(self) | ||
2730 | 57 | self.image, self.rect = load_image('life.gif') | ||
2731 | 58 | self.rect.left = self.left | ||
2732 | 59 | self.rect.top = self.top | ||
2733 | 60 | self.collected = False | ||
2734 | 61 | self.saved = False | ||
2735 | 62 | |||
2736 | 63 | class Log(pygame.sprite.Sprite): | ||
2737 | 64 | def __init__(self, left, top): | ||
2738 | 65 | pygame.sprite.Sprite.__init__(self) | ||
2739 | 66 | self.image, self.rect = load_image('log.gif') | ||
2740 | 67 | self.rect.left = left | ||
2741 | 68 | self.rect.top = top | ||
2742 | 69 | |||
2743 | 70 | class Life(pygame.sprite.Sprite): | ||
2744 | 71 | def __init__(self, left, top): | ||
2745 | 72 | pygame.sprite.Sprite.__init__(self) | ||
2746 | 73 | self.image, self.rect = load_image('life.gif') | ||
2747 | 74 | self.rect.left = left | ||
2748 | 75 | self.rect.top = top | ||
2749 | 76 | |||
2750 | 77 | class Frog(pygame.sprite.Sprite): | ||
2751 | 78 | """Contains all the functions and information regarding the Frog, | ||
2752 | 79 | player controllable character | ||
2753 | 80 | """ | ||
2754 | 81 | def __init__(self): | ||
2755 | 82 | pygame.sprite.Sprite.__init__(self) | ||
2756 | 83 | self.default_image = load_image('betterfrog.gif', -1) | ||
2757 | 84 | self.carry_image = load_image('frogcarry.gif', -1) | ||
2758 | 85 | self.image, self.rect = self.default_image | ||
2759 | 86 | self.starting_left = 374 | ||
2760 | 87 | self.starting_top = 465 | ||
2761 | 88 | self.rect.left = self.starting_left | ||
2762 | 89 | self.rect.top = self.starting_top | ||
2763 | 90 | self.lives = 3 | ||
2764 | 91 | self.score = 0 | ||
2765 | 92 | self.game_over = False | ||
2766 | 93 | self.on_left_log = False | ||
2767 | 94 | self.on_right_log = False | ||
2768 | 95 | self.perfect_score = True | ||
2769 | 96 | self.good_score = True | ||
2770 | 97 | self.start_time = time.time() | ||
2771 | 98 | self.end_time = None | ||
2772 | 99 | self.collecting = False | ||
2773 | 100 | self.collecting_number = None | ||
2774 | 101 | |||
2775 | 102 | def carry_frog(self, left, top): | ||
2776 | 103 | self.image, self.rect = self.carry_image | ||
2777 | 104 | self.rect.left = left | ||
2778 | 105 | self.rect.top = top | ||
2779 | 106 | |||
2780 | 107 | def not_carry_frog(self, left, top): | ||
2781 | 108 | self.image, self.rect = self.default_image | ||
2782 | 109 | self.rect.left = left | ||
2783 | 110 | self.rect.top = top | ||
2784 | 111 | |||
2785 | 112 | def add_score(self): | ||
2786 | 113 | """ This method generates score for the user based on time taken to save the frog. | ||
2787 | 114 | """ | ||
2788 | 115 | #Generate time taken to score: | ||
2789 | 116 | self.end_time = time.time() - self.start_time | ||
2790 | 117 | self.end_time = int(self.end_time) | ||
2791 | 118 | |||
2792 | 119 | #Generate base score: | ||
2793 | 120 | if self.end_time <10: | ||
2794 | 121 | self.base_score = 30 | ||
2795 | 122 | elif self.end_time >=11 and self.end_time <20: | ||
2796 | 123 | self.base_score = 20 | ||
2797 | 124 | else: | ||
2798 | 125 | self.base_score = 10 | ||
2799 | 126 | |||
2800 | 127 | #Generate actual score: | ||
2801 | 128 | if self.perfect_score == True: | ||
2802 | 129 | self.score += (self.base_score)*3 | ||
2803 | 130 | elif self.good_score == True: | ||
2804 | 131 | self.score += (self.base_score)*2 | ||
2805 | 132 | else: | ||
2806 | 133 | self.score += self.base_score | ||
2807 | 134 | |||
2808 | 135 | #Reset timer. | ||
2809 | 136 | self.start_time = time.time() | ||
2810 | 0 | 137 | ||
2811 | === added file 'Frogger/setup.py' | |||
2812 | --- Frogger/setup.py 1970-01-01 00:00:00 +0000 | |||
2813 | +++ Frogger/setup.py 2010-03-12 10:44:17 +0000 | |||
2814 | @@ -0,0 +1,110 @@ | |||
2815 | 1 | #! /usr/bin/env python | ||
2816 | 2 | |||
2817 | 3 | ###BEGIN LICENSE | ||
2818 | 4 | # Copyright (C) 2010 Daniel Bell <daniel.bell@saraclan.com> | ||
2819 | 5 | # | ||
2820 | 6 | #This program is free software: you can redistribute it and/or modify it | ||
2821 | 7 | #under the terms of the GNU General Public License version 3, as published | ||
2822 | 8 | #by the Free Software Foundation. | ||
2823 | 9 | # | ||
2824 | 10 | #This program is distributed in the hope that it will be useful, but | ||
2825 | 11 | #WITHOUT ANY WARRANTY; without even the implied warranties of | ||
2826 | 12 | #MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR | ||
2827 | 13 | #PURPOSE. See the GNU General Public License for more details. | ||
2828 | 14 | # | ||
2829 | 15 | #You should have received a copy of the GNU General Public License along | ||
2830 | 16 | #with this program. If not, see <http://www.gnu.org/licenses/>. | ||
2831 | 17 | ### END LICENSE | ||
2832 | 18 | |||
2833 | 19 | ### | ||
2834 | 20 | # Setup Script for Frog Game: 0.3 | ||
2835 | 21 | # Works on Mac, Windows and Unix based systems. | ||
2836 | 22 | # | ||
2837 | 23 | #Usage (Mac OS X): | ||
2838 | 24 | # python setup.py py2app | ||
2839 | 25 | # | ||
2840 | 26 | #Usage (Windows): | ||
2841 | 27 | # python setup.py py2exe | ||
2842 | 28 | # | ||
2843 | 29 | #Usage (UNIX): | ||
2844 | 30 | # ./setup.py install | ||
2845 | 31 | ### | ||
2846 | 32 | |||
2847 | 33 | #Import stuff required to do the install. Stuff that could not be carried through gets ignored. | ||
2848 | 34 | try: | ||
2849 | 35 | from distutils.core import setup | ||
2850 | 36 | from distutils.command.install_data import install_data | ||
2851 | 37 | from distutils.dep_util import newer | ||
2852 | 38 | from distutils.log import info | ||
2853 | 39 | import glob | ||
2854 | 40 | import os | ||
2855 | 41 | import sys | ||
2856 | 42 | import py2exe | ||
2857 | 43 | from setuptools import setup | ||
2858 | 44 | except ImportError: | ||
2859 | 45 | pass | ||
2860 | 46 | |||
2861 | 47 | #Check if what we are running (and thus installing on) is MAC OSX. | ||
2862 | 48 | if sys.platform == 'darwin': | ||
2863 | 49 | extra_options = dict( | ||
2864 | 50 | setup_requires=['py2app'], | ||
2865 | 51 | app=[frogger], | ||
2866 | 52 | data_files =[ | ||
2867 | 53 | ('data/fonts', glob.glob('data/fonts/*.ttf')), | ||
2868 | 54 | ('data/images', glob.glob('data/images/*.png')), | ||
2869 | 55 | ('data/images', glob.glob('data/images/*.gif')), | ||
2870 | 56 | ] | ||
2871 | 57 | #py2app has certain flags/options that can be enabled. | ||
2872 | 58 | #Setting Icon file, so that generated .app has the icon set automatically. | ||
2873 | 59 | options=dict(py2app=dict(iconfile=data/icons/frog-game.icns)), | ||
2874 | 60 | ) | ||
2875 | 61 | #if we are not using running MAC OSX check if we are running Windows. | ||
2876 | 62 | elif sys.platform == 'win32': | ||
2877 | 63 | extra_options = dict( | ||
2878 | 64 | windows = [ | ||
2879 | 65 | { | ||
2880 | 66 | "script": "frogger", | ||
2881 | 67 | "icon_resources": [(2, "frog-game.ico")] | ||
2882 | 68 | } | ||
2883 | 69 | data_files =[ | ||
2884 | 70 | ('data/fonts', glob.glob('data/fonts/*.ttf')), | ||
2885 | 71 | ('data/images', glob.glob('data/images/*.png')), | ||
2886 | 72 | ('data/images', glob.glob('data/images/*.gif')), | ||
2887 | 73 | ] | ||
2888 | 74 | ) | ||
2889 | 75 | #when its not MAC OSX or Windows we can assume its some sort of UNIX | ||
2890 | 76 | #based system. | ||
2891 | 77 | else: | ||
2892 | 78 | extra_options = dict( | ||
2893 | 79 | scripts=['frogger'], | ||
2894 | 80 | data_files =[ | ||
2895 | 81 | ('share/applications', ['data/frog-game.desktop']), | ||
2896 | 82 | ('share/icons/hicolor/scalable/apps', | ||
2897 | 83 | glob.glob('data/icons/scalable/*.svg')), | ||
2898 | 84 | ('share/icons/hicolor/16x16/apps', | ||
2899 | 85 | glob.glob('data/icons/16x16/*.png')), | ||
2900 | 86 | ('share/icons/hicolor/22x22/apps', | ||
2901 | 87 | glob.glob('data/icons/22x22/*.png')), | ||
2902 | 88 | ('share/icons/hicolor/24x24/apps', | ||
2903 | 89 | glob.glob('data/icons/24x24/*.png')), | ||
2904 | 90 | ('share/icons/hicolor/48x48/apps', | ||
2905 | 91 | glob.glob('data/icons/48x48/*.png')), | ||
2906 | 92 | ('share/frog-game/data/fonts', | ||
2907 | 93 | glob.glob('data/fonts/*.ttf')), | ||
2908 | 94 | ('share/frog-game/data/images', | ||
2909 | 95 | glob.glob('data/images/*.png')), | ||
2910 | 96 | ('share/frog-game/data/images', | ||
2911 | 97 | glob.glob('data/images/*.gif')), | ||
2912 | 98 | ], | ||
2913 | 99 | ) | ||
2914 | 100 | |||
2915 | 101 | setup( | ||
2916 | 102 | version='0.2', | ||
2917 | 103 | description='Fun survival/rescue game!', | ||
2918 | 104 | long_description="The baby frogs are lost! Can you rescue them?", | ||
2919 | 105 | author='Daniel Bell (dbell)', | ||
2920 | 106 | author_email='daniel.bell@saraclan.com', | ||
2921 | 107 | url='https://launchpad.net/frogger', | ||
2922 | 108 | license='GPL v3', | ||
2923 | 109 | **extra_options | ||
2924 | 110 | ) | ||
2925 | 0 | 111 | ||
2926 | === removed file 'Frogger/sprites.py' | |||
2927 | --- Frogger/sprites.py 2010-02-13 16:37:05 +0000 | |||
2928 | +++ Frogger/sprites.py 1970-01-01 00:00:00 +0000 | |||
2929 | @@ -1,141 +0,0 @@ | |||
2930 | 1 | try: | ||
2931 | 2 | import sys | ||
2932 | 3 | import os | ||
2933 | 4 | import pygame | ||
2934 | 5 | import time | ||
2935 | 6 | from pygame.locals import * | ||
2936 | 7 | import weakref | ||
2937 | 8 | except ImportError, err: | ||
2938 | 9 | print "Failure loading module. %s" % (err) | ||
2939 | 10 | sys.exit(2) | ||
2940 | 11 | |||
2941 | 12 | def load_image(name, colorkey=None): | ||
2942 | 13 | fullname = os.path.join('data/images/', name) | ||
2943 | 14 | try: | ||
2944 | 15 | image = pygame.image.load(fullname) | ||
2945 | 16 | except pygame.error, message: | ||
2946 | 17 | print 'Cannot load image:', fullname | ||
2947 | 18 | raise SystemExit, message | ||
2948 | 19 | image = image.convert() | ||
2949 | 20 | if colorkey is not None: | ||
2950 | 21 | if colorkey is -1: | ||
2951 | 22 | colorkey = image.get_at((0,0)) | ||
2952 | 23 | image.set_colorkey(colorkey, RLEACCEL) | ||
2953 | 24 | return image, image.get_rect() | ||
2954 | 25 | |||
2955 | 26 | |||
2956 | 27 | class Leftcar(pygame.sprite.Sprite): | ||
2957 | 28 | """ | ||
2958 | 29 | Left Car functions. | ||
2959 | 30 | """ | ||
2960 | 31 | def __init__(self, left, top): | ||
2961 | 32 | pygame.sprite.Sprite.__init__(self) | ||
2962 | 33 | self.image, self.rect = load_image('bettercar2.gif', -1) | ||
2963 | 34 | self.rect.left = left | ||
2964 | 35 | self.rect.top = top | ||
2965 | 36 | |||
2966 | 37 | class Rightcar(pygame.sprite.Sprite): | ||
2967 | 38 | """ | ||
2968 | 39 | Left Car functions. | ||
2969 | 40 | """ | ||
2970 | 41 | def __init__(self, left, top): | ||
2971 | 42 | pygame.sprite.Sprite.__init__(self) | ||
2972 | 43 | self.image, self.rect = load_image('bettercar.gif', -1) | ||
2973 | 44 | self.rect.left = left | ||
2974 | 45 | self.rect.top = top | ||
2975 | 46 | |||
2976 | 47 | class Homefrog(pygame.sprite.Sprite): | ||
2977 | 48 | def __init__(self, left, top): | ||
2978 | 49 | pygame.sprite.Sprite.__init__(self) | ||
2979 | 50 | self.image, self.rect = load_image('smallerfrog.gif', -1) | ||
2980 | 51 | self.rect.left = left | ||
2981 | 52 | self.rect.top = top | ||
2982 | 53 | |||
2983 | 54 | class Log(pygame.sprite.Sprite): | ||
2984 | 55 | def __init__(self, left, top): | ||
2985 | 56 | pygame.sprite.Sprite.__init__(self) | ||
2986 | 57 | self.image, self.rect = load_image('log.gif') | ||
2987 | 58 | self.rect.left = left | ||
2988 | 59 | self.rect.top = top | ||
2989 | 60 | |||
2990 | 61 | class Life(pygame.sprite.Sprite): | ||
2991 | 62 | def __init__(self, left, top): | ||
2992 | 63 | pygame.sprite.Sprite.__init__(self) | ||
2993 | 64 | self.image, self.rect = load_image('life.gif') | ||
2994 | 65 | self.rect.left = left | ||
2995 | 66 | self.rect.top = top | ||
2996 | 67 | |||
2997 | 68 | class Frog(pygame.sprite.Sprite): | ||
2998 | 69 | """ | ||
2999 | 70 | Contains all the functions and information regarding the Frog, player controllable character | ||
3000 | 71 | """ | ||
3001 | 72 | def __init__(self): | ||
3002 | 73 | pygame.sprite.Sprite.__init__(self) | ||
3003 | 74 | self.image, self.rect = load_image('betterfrog.gif', -1) | ||
3004 | 75 | self.rect.left = 266 | ||
3005 | 76 | self.rect.top= 661 | ||
3006 | 77 | self.lives = 3 | ||
3007 | 78 | self.score = 0 | ||
3008 | 79 | self.level = 1 | ||
3009 | 80 | self.gameOver = False | ||
3010 | 81 | self.frogsHome = [False, False, False, False, False] | ||
3011 | 82 | self.onLeftLog = False | ||
3012 | 83 | self.onRightLog = False | ||
3013 | 84 | self.perfectScore = True | ||
3014 | 85 | self.goodScore = True | ||
3015 | 86 | self.startTime = time.time() | ||
3016 | 87 | |||
3017 | 88 | def update(self): | ||
3018 | 89 | #moves the frog | ||
3019 | 90 | self.gameAreaCheck() | ||
3020 | 91 | |||
3021 | 92 | def scored(self): | ||
3022 | 93 | |||
3023 | 94 | self.rect.left = 266 | ||
3024 | 95 | self.rect.top= 661 | ||
3025 | 96 | |||
3026 | 97 | self.endTime = time.time() - self.startTime | ||
3027 | 98 | self.endTime = int(self.endTime) | ||
3028 | 99 | |||
3029 | 100 | if self.endTime <5: | ||
3030 | 101 | self.baseScore = 30 | ||
3031 | 102 | elif self.endTime >=6 and self.endTime <15: | ||
3032 | 103 | self.baseScore = 20 | ||
3033 | 104 | else: | ||
3034 | 105 | self.baseScore = 10 | ||
3035 | 106 | |||
3036 | 107 | if self.perfectScore == True: | ||
3037 | 108 | self.score += (self.baseScore + (self.level*5))*3 | ||
3038 | 109 | elif self.goodScore == True: | ||
3039 | 110 | self.score += (self.baseScore + (self.level*5))*2 | ||
3040 | 111 | else: | ||
3041 | 112 | self.score += self.baseScore + (self.level*5) | ||
3042 | 113 | |||
3043 | 114 | self.startTime = time.time() | ||
3044 | 115 | |||
3045 | 116 | def gameAreaCheck(self): | ||
3046 | 117 | if self.onLeftLog != True and self.onRightLog != True: | ||
3047 | 118 | if self.rect.top >=662: | ||
3048 | 119 | self.rect.top -=45 | ||
3049 | 120 | if self.rect.left <=0: | ||
3050 | 121 | self.rect.left +=20 | ||
3051 | 122 | if self.rect.right >=595: | ||
3052 | 123 | self.rect.left -=20 | ||
3053 | 124 | else: | ||
3054 | 125 | if self.rect.right <=0: | ||
3055 | 126 | self.loseLife() | ||
3056 | 127 | if self.rect.left >=600: | ||
3057 | 128 | self.loseLife() | ||
3058 | 129 | |||
3059 | 130 | |||
3060 | 131 | def loseLife(self): | ||
3061 | 132 | self.startTime = time.time() | ||
3062 | 133 | self.goodScore = False | ||
3063 | 134 | self.perfectScore = False | ||
3064 | 135 | self.onLeftLog = False | ||
3065 | 136 | self.onRightLog = False | ||
3066 | 137 | self.rect.left = 266 | ||
3067 | 138 | self.rect.top= 661 | ||
3068 | 139 | self.lives -= 1 | ||
3069 | 140 | if self.lives <= 0: | ||
3070 | 141 | self.gameOver = True |