Link to home
Start Free TrialLog in
Avatar of James Hancock
James HancockFlag for United States of America

asked on

Plz Help me translate this JFrame to Python

Hi, I Am a Python NEWBIE

Does anyone have time to plz show me what this kind of Java JFrame + capability looks like in Python?

This will all be for intended use in a game. Is PyGame more suited to this? Why or why not?
What can PyGame do in this situation?

Thanks

class gameWindow extends JFrame implements MouseListener, KeyListener {

  public gameWindow(ClientNetworkEngine CNE, int x, int y) {
            localCNE = CNE;
            setSize...
            setTitle("Game Window");
            ExternalGameLoopThread eglt = new ExternalGameLoopThread(this);
            setLocation(x,y);
            setVisible(true);
            addMouseListener(this);
            addKeyListener(this);
            eglt.start();
            
  }
       public mousePressed(MouseEvent m) {
           System.out.println("mouse pressed at : "+m.getX()+" , "+m.getY());
       }
       public  keyPressed(KeyEvent k ) {
           System.out.println("key pressed : "+k.getChar());
       }

}

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of mccarl
mccarl
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of James Hancock

ASKER

I think PyGame looks perfect for my needs.
Do you think it will be decent speed / frame-rate for a fully functioning network RTS?
ie a Blizzard quality RTS. Full screen is a big plus. Will graphics at full screen be clunky?

This means I wont have to be mired in Direct X? Which compared to pygame looks tough.

Thanks