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

#51 2012-12-11 18:15:26

technoboy10
Scratcher
Registered: 2007-08-25
Posts: 1000+

Re: EasyAsPy

@Gravitation The GitHub page is here: https://github.com/Technoboy10/easyaspy


So long, 1.4.
http://goo.gl/3JEV9

Offline

 

#52 2012-12-12 03:53:25

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

Re: EasyAsPy

@technoboy10 I get a 404.  hmm

Offline

 

#53 2012-12-12 09:20:52

technoboy10
Scratcher
Registered: 2007-08-25
Posts: 1000+

Re: EasyAsPy

Gravitation wrote:

@technoboy10 I get a 404.  hmm

Hmm... I'll try to get it working today. I've been having some problems with GitHub.
Done. It seems that I didn't actually make the repo.  tongue  It works now.

Last edited by technoboy10 (2012-12-12 10:14:48)


So long, 1.4.
http://goo.gl/3JEV9

Offline

 

#54 2012-12-13 06:10:08

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

Re: EasyAsPy

technoboy10 wrote:

Gravitation wrote:

@technoboy10 I get a 404.  hmm

Hmm... I'll try to get it working today. I've been having some problems with GitHub.
Done. It seems that I didn't actually make the repo.  tongue  It works now.

Ah.

I'm totally new to version controllers... how do I modify the repo? xD

Offline

 

#55 2012-12-13 09:04:33

technoboy10
Scratcher
Registered: 2007-08-25
Posts: 1000+

Re: EasyAsPy

Gravitation wrote:

technoboy10 wrote:

Gravitation wrote:

@technoboy10 I get a 404.  hmm

Hmm... I'll try to get it working today. I've been having some problems with GitHub.
Done. It seems that I didn't actually make the repo.  tongue  It works now.

Ah.

I'm totally new to version controllers... how do I modify the repo? xD

Do you have a GH account? I think you need one. (I'm totally new to this as well.  tongue )


So long, 1.4.
http://goo.gl/3JEV9

Offline

 

#56 2012-12-13 10:23:24

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

Re: EasyAsPy

technoboy10 wrote:

Gravitation wrote:

technoboy10 wrote:


Hmm... I'll try to get it working today. I've been having some problems with GitHub.
Done. It seems that I didn't actually make the repo.  tongue  It works now.

Ah.

I'm totally new to version controllers... how do I modify the repo? xD

Do you have a GH account? I think you need one. (I'm totally new to this as well.  tongue )

Yeah, and  have the GitHub widows client and the Git Shell, so, uh... yeah, it's GraviPy.

Offline

 

#57 2012-12-13 11:08:02

technoboy10
Scratcher
Registered: 2007-08-25
Posts: 1000+

Re: EasyAsPy

I've added you as a collaborator.


So long, 1.4.
http://goo.gl/3JEV9

Offline

 

#58 2012-12-13 23:30:32

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

Re: EasyAsPy

Okay!

We aren't going to use scratch.py, since that allows communication with an open Scratch window, for example, to change a variable in a game from an external Python program.

Offline

 

#59 2012-12-14 11:20:18

technoboy10
Scratcher
Registered: 2007-08-25
Posts: 1000+

Re: EasyAsPy

Gravitation wrote:

Okay!

We aren't going to use scratch.py, since that allows communication with an open Scratch window, for example, to change a variable in a game from an external Python program.

I'm not sure what you mean. Why aren't we using scratch.py?


So long, 1.4.
http://goo.gl/3JEV9

Offline

 

#60 2012-12-14 15:03:09

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

Re: EasyAsPy

technoboy10 wrote:

Gravitation wrote:

Okay!

We aren't going to use scratch.py, since that allows communication with an open Scratch window, for example, to change a variable in a game from an external Python program.

I'm not sure what you mean. Why aren't we using scratch.py?

Scratch.py communicates directly with Scratch, for instance:

Open a Scratch project in the Scratch window.
Open a Python application that uses Scratch.py.
The Python program can trigger broadcasts and set variables in the open Scratch window.

Offline

 

#61 2012-12-14 16:24:46

ohaiderstudios
Scratcher
Registered: 2010-10-31
Posts: 100+

Re: EasyAsPy

I love the idea behind this project and what you're doing with it.

I just joined GH yesterday, so now I'm playing around with all the cool features...
That being said, your repo now has a star, and I may fork it sometime in the future.  big_smile


Fork Clamor on GitHub!

Offline

 

#62 2012-12-14 20:17:39

technoboy10
Scratcher
Registered: 2007-08-25
Posts: 1000+

Re: EasyAsPy

ohaiderstudios wrote:

I love the idea behind this project and what you're doing with it.

I just joined GH yesterday, so now I'm playing around with all the cool features...
That being said, your repo now has a star, and I may fork it sometime in the future.  big_smile

Thanks! I'm also quite new to GH, it's pretty cool from what I've seen.


So long, 1.4.
http://goo.gl/3JEV9

Offline

 

#63 2012-12-17 10:48:12

technoboy10
Scratcher
Registered: 2007-08-25
Posts: 1000+

Re: EasyAsPy

@Gravitation How do I use your code?


So long, 1.4.
http://goo.gl/3JEV9

Offline

 

#64 2012-12-17 12:25:10

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

Re: EasyAsPy

technoboy10 wrote:

@Gravitation How do I use your code?

For each sprite, append a Sprite class object to the Sprites variable
For each script, append a Script class object to the Scripts variable
For each block, append a Block class object to the Scripts variable
Make sure to set the class instance variables correctly
Do the run() method for each script for every frame
That's how it will work, hat blocks and broadcasting remain unimplemented.  tongue

Offline

 

#65 2012-12-17 12:38:19

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

Re: EasyAsPy

Gravitation wrote:

For each script, append a Script class object to the Scripts variable

Shouldn't each Script belong to a Sprite?


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

Offline

 

#66 2012-12-17 13:46:33

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

Re: EasyAsPy

blob8108 wrote:

Gravitation wrote:

For each script, append a Script class object to the Scripts variable

Shouldn't each Script belong to a Sprite?

Hence the "owner" variable in each Script instance.  smile

Offline

 

#67 2012-12-17 14:54:59

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

Re: EasyAsPy

Gravitation wrote:

blob8108 wrote:

Gravitation wrote:

For each script, append a Script class object to the Scripts variable

Shouldn't each Script belong to a Sprite?

Hence the "owner" variable in each Script instance.

Then why the Scripts variable?


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

Offline

 

#68 2012-12-18 01:52:54

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

Re: EasyAsPy

blob8108 wrote:

Gravitation wrote:

blob8108 wrote:


Shouldn't each Script belong to a Sprite?

Hence the "owner" variable in each Script instance.

Then why the Scripts variable?

So that Scripts can modify their parent Sprite; the "owner" variable stores the index of the script's owner, and the Sprites variable is made global.
It's actually the Blocks that modify the sprite, now that I think about it. But still, programming outside of classes seems a bit less confusing to me  smile

Offline

 

#69 2012-12-23 01:52:52

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

Re: EasyAsPy

Bump!

Offline

 

#70 2012-12-23 17:10:52

technoboy10
Scratcher
Registered: 2007-08-25
Posts: 1000+

Re: EasyAsPy

So we need to implement Pygame now?


So long, 1.4.
http://goo.gl/3JEV9

Offline

 

#71 2012-12-24 10:00:20

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

Re: EasyAsPy

technoboy10 wrote:

So we need to implement Pygame now?

yeah.  big_smile

Offline

 

#72 2012-12-24 10:10:39

technoboy10
Scratcher
Registered: 2007-08-25
Posts: 1000+

Re: EasyAsPy

Gravitation wrote:

technoboy10 wrote:

So we need to implement Pygame now?

yeah.  big_smile

Awesome. Where do we start?


So long, 1.4.
http://goo.gl/3JEV9

Offline

 

#73 2012-12-24 12:27:26

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

Re: EasyAsPy

technoboy10 wrote:

Gravitation wrote:

technoboy10 wrote:

So we need to implement Pygame now?

yeah.  big_smile

Awesome. Where do we start?

Try following something like the chimp example for setting up your main loop and such, particularly if you're not familiar with Pygame  smile


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

Offline

 

#74 2012-12-25 07:28:14

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

Re: EasyAsPy

Well, since the eapdef file already contains Pygame and all it's necessities, all we need to do is write a rendering script. Here's my 2 cents:

Code:

from eapdef import *
FPS = 30 //max frame rate
pygame.init()
FPSCLOCK = pygame.time.Clock()
DISPLAYSURF = pygame.display.set_mode((480, 360))
pygame.display.set_caption('Project Name Goes Here')
while True:
    DISPLAYSURF.fill((0, 0, 0))
    DISPLAYSURF.blit(stage.costumes[stage.ccos], (0, 0))
    for i in Sprites:
        DISPLAYSURF.blit(pygame.transform.rotate(i.costumes[i.ccos], 90+i.dir), (i.x+240, i.y+180)) //Because Scratch's coords are from center, and pygame's is from top left. Pygame's rotate function rotates counter-clockwise
    for i in Scripts:
        i.run()
    pygame.display.update()
    FPSCLOCK.tick(FPS)

Just some pseudocode, might work but it's just of the top of my head  smile

Offline

 

#75 2012-12-26 10:02:41

technoboy10
Scratcher
Registered: 2007-08-25
Posts: 1000+

Re: EasyAsPy

@Gravitation Thanks for making sure that the coord systems match up with Scratch.  smile


So long, 1.4.
http://goo.gl/3JEV9

Offline

 

Board footer