This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#26 2012-12-15 00:11:20

OrcaCat
Scratcher
Registered: 2010-06-30
Posts: 500+

Re: The Evil Banana: a side scroller made in Python/Pygame

Gravitation wrote:

OrcaCat wrote:

Gravitation wrote:


I would, but I still have the New Scratcher rank.

Make some projects! You need projects to be a 'Scratcher'.

I know, I've been here for over a year, and have more than 3000 posts, and over 40 projects.  tongue

I'm trying to make my projects as good as possible, so they go really slowly.

} //end offtopic

How's the planning coming along? :3

Lol, if you had 3000 posts you would be at 1000+. Also, upload some projects, please.


     Awesome music     Electrode's theme     Epic music
Bye, 1.x.  sad                             Hello, 2.x!  smile

Offline

 

#27 2012-12-15 01:47:14

Gravitation
New Scratcher
Registered: 2012-09-26
Posts: 500+

Re: The Evil Banana: a side scroller made in Python/Pygame

OrcaCat wrote:

Gravitation wrote:

OrcaCat wrote:


Make some projects! You need projects to be a 'Scratcher'.

I know, I've been here for over a year, and have more than 3000 posts, and over 40 projects.  tongue

I'm trying to make my projects as good as possible, so they go really slowly.

} //end offtopic

How's the planning coming along? :3

Lol, if you had 3000 posts you would be at 1000+. Also, upload some projects, please.

(Other accounts)

Okay, I'll get to work on some projects.  smile

Offline

 

#28 2012-12-15 03:49:23

pinnipediator
Scratcher
Registered: 2012-02-10
Posts: 500+

Re: The Evil Banana: a side scroller made in Python/Pygame

Ok, i'm still on hyper beam so far. How do you want him to do the other move? Will he rear up? Will he ram?
Hyper beam going well, the beam comes from the center of his x, if that's okay.

Offline

 

#29 2012-12-15 14:17:33

OrcaCat
Scratcher
Registered: 2010-06-30
Posts: 500+

Re: The Evil Banana: a side scroller made in Python/Pygame

pinnipediator wrote:

Ok, i'm still on hyper beam so far. How do you want him to do the other move? Will he rear up? Will he ram?
Hyper beam going well, the beam comes from the center of his x, if that's okay.

Here is a demonstration of Meteor mash.

P.S. Skip to 4:54.

Last edited by OrcaCat (2012-12-15 17:13:39)


     Awesome music     Electrode's theme     Epic music
Bye, 1.x.  sad                             Hello, 2.x!  smile

Offline

 

#30 2012-12-15 15:51:48

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: The Evil Banana: a side scroller made in Python/Pygame

OrcaCat wrote:

Until 2.0 is out, on this, our chatroom will be METAPHYSICS. We could set aside some time during the week to work on our collab.

You probably want to link to 2.0, since 3.0 doesn't work. http://scratch.mit.edu/projects/Magnie/2440837

Offline

 

#31 2012-12-15 17:11:26

OrcaCat
Scratcher
Registered: 2010-06-30
Posts: 500+

Re: The Evil Banana: a side scroller made in Python/Pygame

Magnie wrote:

OrcaCat wrote:

Until 2.0 is out, on this, our chatroom will be METAPHYSICS. We could set aside some time during the week to work on our collab.

You probably want to link to 2.0, since 3.0 doesn't work. http://scratch.mit.edu/projects/Magnie/2440837

I figured, so I changed it to mathim.com/pycollab

Last edited by OrcaCat (2012-12-16 00:16:20)


     Awesome music     Electrode's theme     Epic music
Bye, 1.x.  sad                             Hello, 2.x!  smile

Offline

 

#32 2012-12-16 07:12:08

pinnipediator
Scratcher
Registered: 2012-02-10
Posts: 500+

Re: The Evil Banana: a side scroller made in Python/Pygame

You better hadn't! Hyper beam took me ages!

Offline

 

#33 2012-12-16 10:46:14

pinnipediator
Scratcher
Registered: 2012-02-10
Posts: 500+

Re: The Evil Banana: a side scroller made in Python/Pygame

Okay, i've uploaded my animations here
Export the costumes and you'll have quite a lot of frames of animation!
I hope meteor mash is okay, i didn't watch your thing, but i took the name as a hint, it looks like he's throwing exploding rocks.

Offline

 

#34 2012-12-16 12:11:04

OrcaCat
Scratcher
Registered: 2010-06-30
Posts: 500+

Re: The Evil Banana: a side scroller made in Python/Pygame

pinnipediator wrote:

You better hadn't! Hyper beam took me ages!

It's okay.


     Awesome music     Electrode's theme     Epic music
Bye, 1.x.  sad                             Hello, 2.x!  smile

Offline

 

#35 2012-12-17 03:07:39

pinnipediator
Scratcher
Registered: 2012-02-10
Posts: 500+

Re: The Evil Banana: a side scroller made in Python/Pygame

smile  thank goodness  smile 
Do you like my animations?
Have a look at 'too much smiling is bad for you' while you're there [-o<  big_smile 
It is very funny!

Offline

 

#36 2012-12-17 19:35:43

OrcaCat
Scratcher
Registered: 2010-06-30
Posts: 500+

Re: The Evil Banana: a side scroller made in Python/Pygame

Well, meteor mash needs a redo.

EXAMPLE:
http://i.imgur.com/jHQEW.gif
(fail)

Also, could you make a left and right walking animation, and hyper beam to the right (make it a new sprite so you can flip it).

Last edited by OrcaCat (2012-12-17 19:37:54)


     Awesome music     Electrode's theme     Epic music
Bye, 1.x.  sad                             Hello, 2.x!  smile

Offline

 

#37 2012-12-18 02:52:27

pinnipediator
Scratcher
Registered: 2012-02-10
Posts: 500+

Re: The Evil Banana: a side scroller made in Python/Pygame

Okay, but i'll need a picture of metagross side-on

Offline

 

#38 2012-12-18 17:58:11

OrcaCat
Scratcher
Registered: 2010-06-30
Posts: 500+

Re: The Evil Banana: a side scroller made in Python/Pygame

pinnipediator wrote:

Okay, but i'll need a picture of metagross side-on

No, make him walk sideways using the front view. Make the hyper beam go to the side.

Last edited by OrcaCat (2012-12-18 19:18:19)


     Awesome music     Electrode's theme     Epic music
Bye, 1.x.  sad                             Hello, 2.x!  smile

Offline

 

#39 2012-12-18 21:19:54

OrcaCat
Scratcher
Registered: 2010-06-30
Posts: 500+

Re: The Evil Banana: a side scroller made in Python/Pygame

Hey! I'm making Axel F in 8-bit. I think it should be the theme song for this.


     Awesome music     Electrode's theme     Epic music
Bye, 1.x.  sad                             Hello, 2.x!  smile

Offline

 

#40 2012-12-19 12:32:23

pinnipediator
Scratcher
Registered: 2012-02-10
Posts: 500+

Re: The Evil Banana: a side scroller made in Python/Pygame

redone animations here
If hyper beam comes from the middle of his x, i can't really get it to go sideways.
Meteor mash looks more like a punch, and he walks sideways like a crab!
How are they?

Offline

 

#41 2012-12-21 03:14:26

pinnipediator
Scratcher
Registered: 2012-02-10
Posts: 500+

Re: The Evil Banana: a side scroller made in Python/Pygame

Sorry, i don't do chatrooms. I agree-it would be useful, but i don't do them. Not allowed and stuff. Sorry.  sad

Offline

 

#42 2012-12-21 11:38:10

OrcaCat
Scratcher
Registered: 2010-06-30
Posts: 500+

Re: The Evil Banana: a side scroller made in Python/Pygame

pinnipediator wrote:

Sorry, i don't do chatrooms. I agree-it would be useful, but i don't do them. Not allowed and stuff. Sorry.  sad

Oh, oops. I guess we'll have to wait for 2.0  smile


     Awesome music     Electrode's theme     Epic music
Bye, 1.x.  sad                             Hello, 2.x!  smile

Offline

 

#43 2012-12-22 06:01:27

pinnipediator
Scratcher
Registered: 2012-02-10
Posts: 500+

Re: The Evil Banana: a side scroller made in Python/Pygame

I don't know-do you like my animations? Surely the least you can do is export all the frames as images- right click on every single costume and export as image. Then you can use them on python.

Offline

 

#44 2012-12-22 19:04:16

OrcaCat
Scratcher
Registered: 2010-06-30
Posts: 500+

Re: The Evil Banana: a side scroller made in Python/Pygame

pinnipediator wrote:

I don't know-do you like my animations? Surely the least you can do is export all the frames as images- right click on every single costume and export as image. Then you can use them on python.

Yeah, well the problem is that the Scratch exporting is so bad that it exports some as bitmaps and others as Gifs...

Great animations! You should try using Gimp, it has animation built in.

Last edited by OrcaCat (2012-12-22 19:48:18)


     Awesome music     Electrode's theme     Epic music
Bye, 1.x.  sad                             Hello, 2.x!  smile

Offline

 

#45 2012-12-23 04:17:10

pinnipediator
Scratcher
Registered: 2012-02-10
Posts: 500+

Re: The Evil Banana: a side scroller made in Python/Pygame

Serif draw also has animations. The point is, i prefer to animate on scratch because i can upload scratch animations onto the internet.
Also, on python, how do you register a key press, like, how would you get python to react to the up arrow being pressed? Sorry, i'm a beginner, and i haven't found anything that'll do this yet. I mean the python equivilant of this:

 
if <key [up arrow v] pressed?> 
Move (3) steps 
end 
Ignore the 3 steps block.

Offline

 

#46 2012-12-23 09:35:01

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: The Evil Banana: a side scroller made in Python/Pygame

OrcaCat wrote:

pinnipediator wrote:

I don't know-do you like my animations? Surely the least you can do is export all the frames as images- right click on every single costume and export as image. Then you can use them on python.

Yeah, well the problem is that the Scratch exporting is so bad that it exports some as bitmaps and others as Gifs...

Use kurt to decompile the project file, it'll export all the costumes as PNG files. example.


Things I've made: kurt | scratchblocks2 | this cake

Offline

 

#47 2012-12-23 09:45:19

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: The Evil Banana: a side scroller made in Python/Pygame

pinnipediator wrote:

Also, on python, how do you register a key press, like, how would you get python to react to the up arrow being pressed?

Well, assuming already have a main loop (eg. as described here) that looks something like this:

Code:

while 1:
    clock.tick(60)

    for event in pygame.event.get():
        if event.type == QUIT:
            return

You can add a handler for the up arrow like so:

Code:

        elif event.type == KEYDOWN and event.key == K_UP:
            return

Alternatively, use `pygame.key.get_pressed()` to return the current state of all the keys, and index it with the key constant:

Code:

if pygame.key.get_pressed()[K_UP]:
    # do stuff

See the complete list of key constants. Make sure you use `from pygame.locals import *`.

Last edited by blob8108 (2012-12-23 09:45:41)


Things I've made: kurt | scratchblocks2 | this cake

Offline

 

#48 2012-12-23 11:02:04

OrcaCat
Scratcher
Registered: 2010-06-30
Posts: 500+

Re: The Evil Banana: a side scroller made in Python/Pygame

Wow! You are really experienced in Python! Thanks a lot for the help! I've never figured out how to do

 repeat (10)
do stuff 
in Python. Would you have to do

Code:

x = 0
while x != 10
    #do stuff
    x += 1

?

Last edited by OrcaCat (2013-05-04 12:19:56)


     Awesome music     Electrode's theme     Epic music
Bye, 1.x.  sad                             Hello, 2.x!  smile

Offline

 

#49 2012-12-23 11:16:52

OrcaCat
Scratcher
Registered: 2010-06-30
Posts: 500+

Re: The Evil Banana: a side scroller made in Python/Pygame

Okay. I have Python 3.2 and 2.5. I downloaded pygame-1.9.2a0.win32-py3.2.msi. It doesn't work. Then I downloaded pygame-1.9.1.win32-py2.5.msi for Python 2.5, and it works fine. So I guess we'll be using Python 2.5 from now on...


     Awesome music     Electrode's theme     Epic music
Bye, 1.x.  sad                             Hello, 2.x!  smile

Offline

 

#50 2012-12-23 11:52:00

OrcaCat
Scratcher
Registered: 2010-06-30
Posts: 500+

Re: The Evil Banana: a side scroller made in Python/Pygame

Actually, I think there is a glitch in Pygame. I run this program:

Code:

bif="bg.jpg"
mif="ball.png"

import pygame, sys
from pygame.locals import *

pygame.init()
screen=pygame.display.set_mode((640,360),0,32)

backgroud=pygame.image.load(bif).convert()
mouse_c=pygame.image.load(mif).convert_alpha()

while True:
    for event in pygame.event.get():
        if event.type == QUIT:
            pygame.quit()
            sys.exit
    screen.blit(background, (0,0))

    x,y = pygame.mouse.get_pos()
    x -= mouse_c.get_width()/2
    y -= mouse_c.get_height()/2

    screen.blit(mouse_c, (x,y))

    pygame.display.update()

and I get this error:

Code:

Traceback <most recent call last>:
    File "C:\Python25\pygametest.py", line 4, in <module>
        import pygame, sys
ImportError: Bad magic number in C:\Python25\pygame.pyc

Weird...


     Awesome music     Electrode's theme     Epic music
Bye, 1.x.  sad                             Hello, 2.x!  smile

Offline

 

Board footer