[Community pygame project] Plants vs Zombies

Re: [Community pygame project] Plants vs Zombies

Postby metulburr » Mon Jul 15, 2013 5:06 am

@Metul did you see the demo layout I threw in the Survival state (and the ultra-cute sun I made :D ).

oh yeah i saw it. At the exact same time i was making the layout attempting to do the same. Then i saw yours, and threw mine out. Mine was horrible opposed to yours, lol.
New Users, Read This
OS Ubuntu 14.04, Arch Linux, Gentoo, Windows 7/8
https://github.com/metulburr
steam
User avatar
metulburr
 
Posts: 1420
Joined: Thu Feb 07, 2013 4:47 pm
Location: Elmira, NY

Re: [Community pygame project] Plants vs Zombies

Postby jkbbwr » Mon Jul 15, 2013 9:00 am

jkbbwr
 
Posts: 17
Joined: Mon Feb 11, 2013 10:25 am

Re: [Community pygame project] Plants vs Zombies

Postby Mekire » Mon Jul 15, 2013 12:31 pm

jkbbwr wrote:Lines 6-17 seem entirely redundant.

The docstring? How would you prefer it look? I admit in such a short module it is a bit redundant but it is written as such to be consistent in style with the other modules.

Code: Select all
>>> import data
>>> help(data.setup)
Code: Select all
Help on module data.setup in data:

NAME
    data.setup

FILE
    c:\python27\lib\python modules\plant_versus_zomb\plants-vs-zombies\data\setup.py

DESCRIPTION
    Module: setup.py
    Overview:
        This module initializes the display and creates dictionaries of resources.
    Imports:
        os
        pygame as pg
        from . import tools
    Global Constants:
        SCREEN_SIZE
        ORIGINAL_CAPTION
        SCREEN
        SCREEN_RECT
        FONTS
        MUSIC
        GFX
        SFX

DATA
    FONTS = {'Fixedsys500c': r'resources\fonts\Fixedsys500c.ttf', 'impact'...
    GFX = {'forum': <Surface(175x204x32 SW)>, 'plant_sheet': <Surface(72x3...
    MUSIC = {}
    ORIGINAL_CAPTION = 'Botany vs Biomass'
    SCREEN = <Surface(Dead Display)>
    SCREEN_RECT = <rect(0, 0, 800, 600)>
    SCREEN_SIZE = (800, 600)
    SFX = {}

-Mek
User avatar
Mekire
 
Posts: 987
Joined: Thu Feb 07, 2013 11:33 pm
Location: Amakusa, Japan

Re: [Community pygame project] Plants vs Zombies

Postby jkbbwr » Mon Jul 15, 2013 12:44 pm

"""
This module initializes the display and creates dictionaries of resources.
"""

Done. Anything else can be derived by any half decent programmer.
jkbbwr
 
Posts: 17
Joined: Mon Feb 11, 2013 10:25 am

Re: [Community pygame project] Plants vs Zombies

Postby The Merry Lurker » Tue Jul 16, 2013 1:53 am

A quick note-- I didn't know Plants vs. Zombies was already a thing (because apparently I've been living under a rock :P ) and I drew these before a friend told me about it. They don't look like the plants and zombies from the game, but keep in mind they can be re-drawn.

Image Image Image Image Image Image Image Image
Image Image Image Image Image Image Image Image

Image
Image
User avatar
The Merry Lurker
 
Posts: 5
Joined: Sun Jul 14, 2013 7:14 pm

Re: [Community pygame project] Plants vs Zombies

Postby metulburr » Tue Jul 16, 2013 7:34 am

Of course this is just my opinion:

Can you add one or two more sprites per movement. It looks unnatural with just 2. I believe we were using the standing zombies walking. But of course a crawling zombie could put some originality feel to it.

I would focus more on the pea shooter looking thing facing the right, but could you add something like 4 images for swaying back and forth (idling) and 4 images for shooting his (pea) where his head moves back or something



EDIT:
Oh i just got another idea for originalty based on your images The Merry Lurker. What if the zombies had a 5% chance of changing lanes. I have been playing it more since we came up with this idea, and i realized that you come to rely on the fact that once they spwn in that lane of grass, they will end up at the house on that lane of grass. Making it very predictable. There was actually a point in the full game, where a hoard of zombies penetrated far enough to where i had no more lawn mowers left, and i knew there was only like 4 zombies left, in the only lane i had pea shooters left. So if they were to change "lanes" it would make it very difficult at times.
New Users, Read This
OS Ubuntu 14.04, Arch Linux, Gentoo, Windows 7/8
https://github.com/metulburr
steam
User avatar
metulburr
 
Posts: 1420
Joined: Thu Feb 07, 2013 4:47 pm
Location: Elmira, NY

Re: [Community pygame project] Plants vs Zombies

Postby Mekire » Tue Jul 16, 2013 11:25 am

The Merry Lurker wrote:A quick note-- I didn't know Plants vs. Zombies was already a thing (because apparently I've been living under a rock :P ) and I drew these before a friend told me about it. They don't look like the plants and zombies from the game, but keep in mind they can be re-drawn.
This is an excellent start. I'll hack up something as soon as I get a chance so we can better visualize.

Couple things. As Metul said, a fundamental projectile throwing plant is necessary. Also, I agree with Metul's analysis on the animation. 2 frames can look quite nice in retro style games but you might want to consider 3 or 4 here. Also we have transformation functions in pygame so don't worry about mirror images (i.e. left and right).

As for uniqueness I would like to stay as far away from the original as possible (perhaps completely diverging if we have inspiration enough and developing something completely unique). I was also playing with the idea of the plants as the antagonists attacking hordes of hapless protagonist zombies. As for zombies changing lanes this is something we can easily play around with once we have a working prototype.

-Mek
User avatar
Mekire
 
Posts: 987
Joined: Thu Feb 07, 2013 11:33 pm
Location: Amakusa, Japan

Re: [Community pygame project] Plants vs Zombies

Postby Kebap » Tue Jul 16, 2013 7:03 pm

As for somebody who doesn't even know anything about Plants vs Zombies, can you enlighten some more of the general scope of this project? Do you just want to clone this game in python? Can the original game be added onto by python? I find no introduction here.
octopez wrote:I guess you won't want to have an exact clone of Plants vs Zombies, do you?
Learn: How To Ask Questions The Smart Way
Join the #python-forum IRC channel on irc.freenode.net and chat with uns directly!
Kebap
 
Posts: 390
Joined: Thu Apr 04, 2013 1:17 pm
Location: Germany, Europe

Re: [Community pygame project] Plants vs Zombies

Postby Mekire » Tue Jul 16, 2013 11:30 pm

Kebap wrote:As for somebody who doesn't even know anything about Plants vs Zombies, can you enlighten some more of the general scope of this project? Do you just want to clone this game in python? Can the original game be added onto by python? I find no introduction here.

The primary goal of this project was simply to try to work together as a group. Plants vs Zombies was suggested and people expressed interest so we have taken that as a starting point. I would personally like to end up with something that is fundamentally distinct in the end; but if nothing else is accomplished here than getting some experience working in a group, then the goal will have been accomplished.

Basically "Plants vs Zombies" is just a simple tower defense game, and is in itself not particularly unique. It gained its popularity due to its appealing graphical style and its casual game play; which starts simple enough for anyone and grows to be fairly challenging.

I don't think we should limit ourselves in any way if anyone has unique ideas to bring to the table. At the same time, having some generic target to aim at allows us to work towards a goal without being bogged down in planning out mechanics.

-Mek
User avatar
Mekire
 
Posts: 987
Joined: Thu Feb 07, 2013 11:33 pm
Location: Amakusa, Japan

Re: [Community pygame project] Plants vs Zombies

Postby The Merry Lurker » Thu Jul 18, 2013 10:01 pm

Thanks for the feedback on the sprites! I'll be working on them more, but I may be a little bit slower because my webcomic has been begging for attention. :P I do have a few questions, though, about future graphics.

*Is there a semifunctional version of the game that I can look at to get an idea of where you are, and what you need other than character sprites?
*What about environments? Do you do one image, layered two-dimensional images, or tile-based maps? (or other?)
*Diagonal sprites. Do you need them? Could you use them?
*What dimensions should the sprites for the projectiles be?
*Are buttons separate graphics? For example, would the "Start Game" etc. buttons be integrated in the title screen image, or virtually laid on top of it?
*I've been assuming the imaginary camera angle is something in the area of top-down at roughly a 45-degree angle. (Think Pokemon) Is this right?
*Are Zombies melee?

I'm sure I'll think of more later. In the meantime I'll be working on idling plants and walking zombies. Maybe I'll smooth out the animation for the crawlers, too, just for the sake of options.

Fun fact: the severed arm in the zombie's hand was added to be used as a potential projectile, in case one was needed.
Image
User avatar
The Merry Lurker
 
Posts: 5
Joined: Sun Jul 14, 2013 7:14 pm

Re: [Community pygame project] Plants vs Zombies

Postby metulburr » Thu Jul 18, 2013 10:27 pm

*Is there a semifunctional version of the game that I can look at to get an idea of where you are, and what you need other than character sprites?

there is the repo of the game on github you can download and see (which is currently using your sprites given)

*What about environments? Do you do one image, layered two-dimensional images, or tile-based maps? (or other?)

i dont believe this is figured out yet.

*Diagonal sprites. Do you need them? Could you use them?

if an image can be rotated, no we dont need them as pygame has methods to rotate images. Then we just have one image and can spin it 360 degrees and way needed.

*What dimensions should the sprites for the projectiles be?

i would assume something relevant to the size of the pea shooters mouth, maybe a hair bigger. But we can resize the image in pygame anyways

*Are buttons separate graphics? For example, would the "Start Game" etc.

The currentl placeholder is currently using text, but i think graghic buttons would look better


A lot of these question have yet to be discussed until now. So it is all up in the air. I think we would program it based on what the graphics are.
New Users, Read This
OS Ubuntu 14.04, Arch Linux, Gentoo, Windows 7/8
https://github.com/metulburr
steam
User avatar
metulburr
 
Posts: 1420
Joined: Thu Feb 07, 2013 4:47 pm
Location: Elmira, NY

Re: [Community pygame project] Plants vs Zombies

Postby Mekire » Fri Jul 19, 2013 2:07 am

Projectiles:
Make projectiles an appropriate size for the sprite shooting them. After we have a graphic we can easily place them on a sheet to fit our needs.

Environment:
I don't anticipate needing a tile map editor for this program but if it becomes necessary it is of course an option. I think environments consisting of one background layer and perhaps a simple ambient weather layer (ie rain, clouds etc) would be more than enough. We will start simple and go from there. If later we want a multilayer effect or find we need tile map editors, we can write that in.

Menu Buttons:
As said, currently the placeholder menu uses simple highlighting text but this is probably not what the end product will look like. If you look at the official free flash version of PvZ, you can see they use a gravestone that highlights when the mouse hovers over it. We can easily accomplish similar (though I encourage you to be unique :D). Basically if you have a good graphical idea we can probably accommodate you.

Diagonal sprites:
Not positive what you mean here. You mean frames for the sprites traveling at angles? Currently this is not necessary. As Metul has said we do have rotation functions, although because rotation is destructive (especially on pixel art), individually drawing rotated versions is always superior when time allows. Perhaps in the future.

-Mek
User avatar
Mekire
 
Posts: 987
Joined: Thu Feb 07, 2013 11:33 pm
Location: Amakusa, Japan

Re: [Community pygame project] Plants vs Zombies

Postby DrakeMagi » Tue Jul 23, 2013 9:05 pm

Finally made my sad tomato slinger and my first pull request.
Still learning blender.
Linux: won't find windows here.
Linux: the choice of a GNU generation.
https://github.com/DrakeMagi
DrakeMagi
 
Posts: 106
Joined: Sun May 12, 2013 8:36 pm

Re: [Community pygame project] Plants vs Zombies

Postby Mekire » Wed Jul 24, 2013 12:41 am

Looks really nice. I threw a resized version in my survive state to check out the animation. Unfortunately it doesn't show up well against my shitty stock grass background, but that is easily fixed. The grass background was never meant to be permanent. Are the bottom five frames death frames, or are they the tomato growing back after being thrown? Also, are your images easily resizable in blender (I resized them in PDN and they still look good, but of course they lost a little detail)? I have currently been working with 72x72 pixel frames. These allow us to maintain a board that is 9 cells across and still have a small buffer on the left and right.

On another issue:
I realized that I unknowingly added a dependency on numpy by using the pygame.surfarray functionality. This was the simplest way to add semi-transparency to a surface that already contained per-pixel alpha (for the ghost images while placing a plant). Is everyone comfortable with this dependency?

-Mek

Edit:
Pushed some minor changes to docs and various. Also made it so the Tomato Slinger can be placed on the grid in survive mode. Removed the background grass as it was obscuring the sprites.
User avatar
Mekire
 
Posts: 987
Joined: Thu Feb 07, 2013 11:33 pm
Location: Amakusa, Japan

Re: [Community pygame project] Plants vs Zombies

Postby DrakeMagi » Wed Jul 24, 2013 1:19 am

The top 5 is for throwing the tomato
right to left. then jumps back to center(3rd image). Then use plant empty one and use tomato.png for throwing image.
tomato.png is center with the tomato plant.

Middle 5 for idle
right to left, then left to right.

Bottom 5 for plant regrowth.
what for a second on empty plant. then start regrowth of the tomato.

At least that how I intended it to be.
I use gimp and a script to build sprite sheet. It built them from right to left instead of left to right.

1. I'm no artist. There wasn't much detail to begin with.

2. i was wonder what size. but in plants vs zombies there must have 2 sizes because the backyard has 6 spaces down.
Linux: won't find windows here.
Linux: the choice of a GNU generation.
https://github.com/DrakeMagi
DrakeMagi
 
Posts: 106
Joined: Sun May 12, 2013 8:36 pm

Previous

Return to Game Development

Who is online

Users browsing this forum: No registered users and 2 guests