| Java Swing Graphical User Interface (gui) |
Athura - Roguelike
Friday, October 19, 2012
New Year New Start
Monday, August 13, 2012
Going steady
I am now using pygcurses for my roguelike. I have been exploring many other opensource python roguelikes so that I can understand how to make a game that can actually become a more advanced game if I do so wish much later down the line. I am going slow again and still because I want to write consistent code and so that I can write and comment the code in a way that I can know what it does. As far as progress goes, I have my user that can run around in a room that I made and collides with a wall. I decided not to go with a scrolling window, as it gave me problems before, and go a fixed window like in the original game Rogue. It has no fancy features or combat yet but just having simple working functionality's is a big step for me. I have to learn all of what I am doing by my self. I keep finding enormous amounts of elaborate tutorials that I cannot possibly read at any reasonable rate. I just scan through most of them and most of them are basic syntax tutorials any way which does not help me in the slightest. So in Athura there is a monster that has a simple wander algorithm that I made so that he can stroll around the room. I am looking at adding combat soon, only basic combat though so that I will do like one damage to me and one to him. I can tweak how much later. The toughest part has been just to find what to do and learn how to do it. Recently I have gone and learned about several more advanced applications in python. One that is unique to python is the dictionary, which is a hashable data source that stores information that is indexed by keys. Also dipped a little into recursion and pickling, which is a way so save the objects that you have created during the time that the program is open. I am not too far into programming a roguelike. I am going slow to make sure that it is done right.
All the lore I feel like making at the moment for a game with almost no functionality -
We have hand selected you for your talent and leadership that you have shown during your training session. We are conducting an expedition into the depths of Athura. Athura is a mountain made from a once volatile volcano. A sheep farmer discovered a hole in the side of the mountain when his sheep were grazing in the fields. We need you to explore the depths and report back to central command what you have discovered I wish the best of luck to you men, you may need it.
![]() |
| I went basic and I am just using ASCII characters now |
We have hand selected you for your talent and leadership that you have shown during your training session. We are conducting an expedition into the depths of Athura. Athura is a mountain made from a once volatile volcano. A sheep farmer discovered a hole in the side of the mountain when his sheep were grazing in the fields. We need you to explore the depths and report back to central command what you have discovered I wish the best of luck to you men, you may need it.
Try and fail with visual tiles in pygame
I wanted to make a roguelike but did not want to use ASCII characters as the visual on my GUI so I went to using the same module that I used for my mastermind game. I used pygame to help display my tiles that I made myself (that did not look the greatest). I started by making a random map generator, and when I say random map generator I mean that there would be a 5% chance for a rock to spawn on a tile. Extremely basic, just so that I could get everything else to work. I was also able to save and load my map to a text file. When I first got my whole map to print onto my GUI I was incredibly happy. It made me feel like I could accomplish something instead of just reading piles of PDF tutorials I found online. I got my character to move and collide with rocks and terrain so that he could not move through them. I had several major problems though, printing of the map at the edges of the generated map (for example coordinates 10, 7 of a 400-400 map) was extremely glitchy, I could not figure out how to make creeps that could move around that map and go any further with my current design. Getting my anything done on my first attempt took forever because I had to learn how to use Classes and things of the sort, because I only have one year of computer science at school to teach me I don't even know basic things about python, mostly because a lot of what I learned was in Java. So every time I went to make a method or part of a class I usually spent about half an hour online looking up how to make my class. I got angry with my design and decided that pygame was not the way to go for me. I thought simple might not be bad so I looked at a lot of the other roguelike programs and a lot of them were programmed in curses module for various languages. I looked it up, learned about it and its origins from the time of early computers. Tried to use it, and... It can only be used on Linux. Me having all windows computers did not feel like running Ubuntu on my computer, which I have but don't use often. I looked for something else to run my program in. And eventually found pygame-curses. It was a godsend, because I already knew a fair amount about pygame and they made a simple modification to come up with the curses module with windows compatibility. Another big reason that I restarted was that I lacked cohesion in my program and knew that I would not be able to program anything complicated later if the starting blocks of my program is crudely put together and I was loosing what some of my methods did and only knew what they outputted some of the time. I felt it was time for a hard restart due to the poor quality of my design.
![]() |
| User in my world made with pygame |
Background to starting Athura
I am going into my Senior year in high school with a year of computer science under my belt. This was from a basic intro to computer science course. We learned Java and Python, but it was basic syntax of if, for, while loops. I was really interested from the start and wanted to continue. I liked python from the moment I opened the interpreter because of its simple and easy to use designing. When we transitioned into java I learned much more about the language than I did for python, but I found it clunky and it seemed like it used a lot of unnecessary syntax's and semicolons and labeling. We used java a lot and I read quite a lot on the syntax's and uses of methods and classes in Java. After the year was done I was looking for something to program over the summer. I had been drawn to python so I read a little bit about the language but I never got into programming anything large because I had no ideas of what to program. In my opinion I feel that the best way to learn a language is to do a bunch of small projects so that you can find out what you would need to learn to implement into your program. You see all of the flaws in your programming skills and it also gets you much more involved and motivated. Also for me it helps me to remember the syntax and the quarks of the languages if I type it a bunch of times and visualize how it affects the program. I was looking at some tutorials online and was looking for something to program, but they seemed too easy or stupid. Eventually I decided to program mastermind which is a game where you guess a code generated by the computer. It was rough to say the least, I didn't know how to use classes and a lot of the program was hard coded. Although it was a rough design, it helped me to learn a lot more about the language. I used pygame, which is a module that you can use for python to help with graphical interfaces. I wanted to program something that looked nice. For several weeks of stumble through the computer science world I was asking my friend how he was doing and what he was keeping himself busy with. He told me that he learned XML and was programming a roguelike. My memory was a little fuzzy on what a roguelike was so he filled me in. I was instantly interested in the genre. I got rogue and played it for several hours and looked up the basics of the game. I learned about a ton of features and functions of python that I had not known about before. It was the boost of motivation and intrigue that I needed this summer.
Subscribe to:
Posts (Atom)

