Tag Archives: pyjs

Inside Look – pyjs

Although not directly affiliated with my own personal project, I still want to try making some posts about interesting Python things I run across and use. Today’s Inside Look is about pyjs! I mentioned it in my last post, but I wanted to give a little more insight into it and why I have been using it.

Now that I’ve been working on some web development, I was thinking my only options would be Javascript and some CSS. I started doing some self-learning to review what Javascript I knew, but for what our team wanted to do, it felt so cumbersome and difficult to will the code to my expectations. This spurred me on to look for some alternative, maybe a way that I could stay with Python, but have all power and control that Javascript has. I nearly immediately ran into pyjs, the Python web app developer’s best friend. It quite literally converts your written Python code into Javascript. There is a large support for most of Python’s built-ins and most imported modules seem to work just fine. I’ve had some issues with using time.sleep(), but I may just be doing something wrong. Pyjs also includes its own module which contains a large amount of UI classes to use and expand upon.

I’ve been designing the prototype for the game using Panels. These are simply cells in a table. Eventually, I would like to progress to using the Canvas. This will probably require more art assets (just basics available right now) and some re-organizing of existing code to be more Canvas, less table. I’m having a meeting tonight with the three other team members to go over weekly progress and what we’d like to focus work on. Hopefully we can get a place to host our app (we’re looking at Chrome Web Store) so we can get testing on multiple platforms and make it easily available for people to play!

If pyjs just isn’t flexible enough or proves to much of a hurdle just to use Python, we may eventually switch over to Javascript. At least transferring Python over to Javascript will be easy!

Tagged , ,

A Little Break from The First Fantasy

With v0.1 released, I feel like it’s in a nice, stable place to sit for a little while. In the meantime, I’ve volunteered to join a small group of my friends in our attempt to make a web game. This is something I’ve never really done before. JavaScript is mostly foreign to me, especially CSS and advanced web concepts. However, I’ve found and have been using a handy tool called pyjs (or PyJamas). It literally takes your python code and compiles it into JavaScript. It also provides a number of modules to facilitate a more “web focused” design. This is also my first “real” attempt at running the entire game through GUI elements.

We’re starting off with a simple Blackjack game to make sure we can get through the entire process (brainstorm, design, art, code, web stuff, hosting) without too many problems. If it all works out and we’re mildly impressed, we may try to make some actual attempts at bringing in some money with future games. It should be fun and already is a definite learning opportunity. I’ll post some information about it when I can, but we’d like to be as hush-hush about it until we know what the hell we’re doing!

Tagged , , ,
%d bloggers like this: