Re: [pygame] man oh man Java is painful

2011-11-03 Thread Ian Mallett
On Thu, Nov 3, 2011 at 10:16 AM, James Paige wrote:

> On Thu, Nov 03, 2011 at 01:11:08PM -0300, Sean Wolfe wrote:
> > really excited just from a religious standpoint... I mean how many
> > cool games have been made with Java? ...none?
>
> Minecraft.
>
> But that is the only one I can think of!
>
> Also, I understand that the Android port of Minecraft is NOT the Java
> version, it is mostly re-written in C, so I guess this is the exception
> that proves the rule :)

I might argue that part of the reason for the fact that there are few is
that Java encourages lazy programming--which is one reason why it has
become so popular.  You *don't need* to think about pointers and array
lengths and memory allocation like you do in C, and you don't need to think
about dynamic types and efficiency and elegance like you do in Python.

The plain fact is that Java makes it easy to (start) doing whatever you
want.  On the one hand, good--but on the other, you get a massive amount of
garbage code from people who don't know what they're doing.  Even if you do
know what you're doing, it's easy to get lazy--and it takes actual effort
to avoid code bloat.  When I am forced to use Java, I often find myself
doing the easy thing instead of the right thing, despite myself.

Java's "revolutionary" JavaDoc is actually necessary because Java code
tends to get so messy that its incomprehensible to everyone--even the
original authors.  The reason there are no big games written in Java is
because it takes a huge team of people to get any big project even
*working*in Java.  Furthermore, making successful games requires
effort and
thought--and those who prefer using Java tend to prefer being lazy.

Game companies hire competent, successful programmers who can't afford to
sacrifice code readability for effort.  It follows that Java is unpopular.
 Minecraft (in its initial incarnation) was falling-down simple, and it
took an experienced programmer to make it.  The game is getting more
sophisticated, but then, there have been a number of people working in it
for years.  Think about it: a character walks around with some tools, and
removes and places little cubes.  Fun, maybe, but sophisticated?  Not so
much.

Ian


Re: [pygame] man oh man Java is painful

2011-11-03 Thread James Paige
On Thu, Nov 03, 2011 at 01:11:08PM -0300, Sean Wolfe wrote:
> really excited just from a religious standpoint... I mean how many
> cool games have been made with Java? ...none?

Minecraft.

But that is the only one I can think of!

Also, I understand that the Android port of Minecraft is NOT the Java 
version, it is mostly re-written in C, so I guess this is the exception 
that proves the rule :)

---
James Paige


Re: [pygame] man oh man Java is painful

2011-11-03 Thread Sean Wolfe
BTW I just picked up Pro Android Games, where the author takes C code
from wolfenstein and uses the Android native libary + only a little
bit of java... I am stoked about this approach.

It's based on Android 1.5, so a little out of date now, but I'm still
really excited just from a religious standpoint... I mean how many
cool games have been made with Java? ...none? And how many with C/cpp?
Like most of them? So we can use a little bit of java and a lot of cpp
and be at peace with the gaming gods of old.

@ Mac Ryan, definitely going to check out golang as well... heard
about that one.

On Thu, Nov 3, 2011 at 11:52 AM, Mac Ryan  wrote:
> On Thu, 03 Nov 2011 14:19:28 +1300
> Greg Ewing  wrote:
>
>> I've yet to decide whether there's a place for a language
>> that combines Python's flexibility and get-out-of-your-way
>> nature with static type checking and efficient code generation.
>> If there is, I don't think that language exists yet.
>
> Absolutely not sure it fits the bill... but have you had a look at go?
>
> http://golang.org/
>
> It's used by folks at Google, and since they are probably the biggest
> sponsor of python there are good chances they used some python-wisdom
> in crafting it...
>
> /mac
>



-- 
A musician must make music, an artist must paint, a poet must write,
if he is to be ultimately at peace with himself.
- Abraham Maslow


Re: [pygame] pygame.surfarray.pixels2d does not work with OpenGL?

2011-11-03 Thread Lenard Lindstrom


You could create an empty surface with RGBA order, then blit to it:image = pygame.image.load(filename)surf = pygame.Surface(image.get_size, pygame.SRCALPHA, 32, masks=(0xFF, 0xFF00, 0xFF, 0xFF00))surf.blit(image, (0,0))But there is no way to load an external file into a surface with a different format. Maybe, if the PNG file had the desired RGBA order to start with... (Is that even possible?)Nov 2, 2011 05:28:17 AM, pygame-users@seul.org wrote:Mmh, I see. Is there any way to have a 32 bit source alpha surfacehave pixels in that order? Or is there any other way how to speed upmy code by replacing tostring?On Tue, Nov 1, 2011 at 10:14 PM, Lenard Lindstrom  wrote:> Hi,>> Function tostring unmaps each pixel into an RGBA sequence, with the R byte> lowest. Function pixels2d returns a view of the actual surface memory. A 32> bit source alpha surface need not, and probably does not, have pixels in an> RGBA order.>> Lenard Lindstrom>> On Oct 31, 2011, Florian Krause  wrote:>> Hi everyone,>> can anyone tell me what I am doing wrong here?> Please have a look at the attached example code.>> When using pygame,image.tostring for getting the pixel values to> transform them into a texture, everything works well (see the> outcommented part with WORKS).>> However, when I replace this part with pygame.surfarray.pixels2d, then> the resulting texture seems broken for some reason.>> Does anyone have an idea what is going on here?>> Thanks in advance,> Florian>-- www.fladd.de - fladd.de: Homepage of Florian Krauseblog.fladd.de - fladd's Blog: Blog of Florian Krauseintermezzo.fladd.de - Intermezzo: Music by Florian Krause and Giacomo Novembre



Re: [pygame] man oh man Java is painful

2011-11-03 Thread Mac Ryan
On Thu, 03 Nov 2011 14:19:28 +1300
Greg Ewing  wrote:

> I've yet to decide whether there's a place for a language
> that combines Python's flexibility and get-out-of-your-way
> nature with static type checking and efficient code generation.
> If there is, I don't think that language exists yet.

Absolutely not sure it fits the bill... but have you had a look at go?

http://golang.org/

It's used by folks at Google, and since they are probably the biggest
sponsor of python there are good chances they used some python-wisdom
in crafting it...

/mac


Re: [pygame] man oh man Java is painful

2011-11-03 Thread Russell Jones
Well, there is jython . It's a version of Python
that runs under the JVM with, roughly, Python 2.5 syntax. I think you can
use Java objects from it, so you'd need to use  Java APIs for graphics. I'm
all but certain that pygame wouldn't be available.

Russell