• Advertisement
  • Popular Tags

  • Popular Now

  • Advertisement
  • Similar Content

    • By Arnold // Golden Donkey Productions
      Where to get started in making a text based MUD?
       
      So I have been making small games for over 3 years now and I'm comfortable in the programming languages that follow:
      1. Python (I need a bit of practice with this)
      2. C# (I am the most comfortable in this)
      3. Java (I know quite a bit but might need to do a tad of research)
       
      and I have also done a bit in:
      4. JS (I know pretty much nothing here)
      5. And some other stuff
       
      Anyway, so now you know all that rubbish here goes. What I wan't to do is program a text based MMORPG or a text based MUD. I have basically no clue where to begin so I what I need is some places to start. If anyone has any information on the subject, anything at all, please post it bellow. I will be really appreciated.
    • By Vansh Gupta
      A simple arcade game in python.I am currently in class 9th and made this game using python
    • By RidiculousName
      I've made a very simple map generator as a demo for combat encounters in my game. I plan to have the trees and rocks be cover, while the player's bandits ambush a caravan on the road in the middle. Please, let me know what you think. Criticism is welcome.
      """ Generates a basic map for combat """ __Author__ = "RidiculousName" __date__ = "3/21/18" import pygame as pg import copy import random def createMap(width, height, trees, rocks, roadWidth): """ creates a combat map :param width: int; 20-60 width of map in squares :param height: int; 20-60 height of map in squares :param trees: int; 0 to (width*height)//5 # of trees in map :param rocks: int; 0 to (width*height)//5 # of rocks in map :param roadWidth: int; 0-10 width of road in map (if value=0, will not have a road) :return: tuple matrix of map """ # variable declarations mapMatrix = [] rowList = [0] * width treeLocations = [] rockLocations = [] colIndex = random.randint(0, height) rowIndex = random.randint(0, width) #error checking if trees > (width * height) // 3: print("ERROR: TOO MANY TREES") return 0 elif rocks > (width * height) // 3: print("ERROR: TOO MANY ROCKS") return 0 # create a blank map full of grass for i in range(height): row = copy.copy(rowList) mapMatrix.append(row) # add trees for i in range(trees): while (rowIndex, colIndex) in treeLocations: colIndex = random.randint(0, height - 1) rowIndex = random.randint(0, width - 1) mapMatrix[rowIndex][colIndex] = 1 treeLocations.append((rowIndex, colIndex)) # add rocks for i in range(rocks): while (rowIndex, colIndex) in treeLocations \ or (rowIndex, colIndex) in rockLocations: colIndex = random.randint(0, height - 1) rowIndex = random.randint(0, width - 1) mapMatrix[rowIndex][colIndex] = 2 rockLocations.append((rowIndex, colIndex)) # add the road if roadWidth > 0: ct = int(roadWidth // 2) road = int(height // 2) while ct > 0: mapMatrix[road + ct] = [3] * width mapMatrix[road - ct] = [3] * width ct -= 1 mapMatrix[road] = [3] * width # convert to tuple for i in range(height): mapMatrix[i] = tuple(mapMatrix[i]) # return return tuple(mapMatrix) def showMap(screen, mapMatrix): """ :param screen: pygame screen object images are blitted to this :param mapMatrix: list matrix contains the map matrix :return: none """ # variable declarations height = pg.display.Info().current_h width = pg.display.Info().current_w x_pos = 0 y_pos = 0 grass = pg.image.load("grass.png").convert() tree = pg.image.load("tree.png").convert() rock = pg.image.load("rock.png").convert() road = pg.image.load("road.png").convert() for i in range(len(mapMatrix)): for j in range(len(mapMatrix[i])): if mapMatrix[i][j] == 0: screen.blit(grass, [x_pos, y_pos]) elif mapMatrix[i][j] == 1: screen.blit(tree, [x_pos, y_pos]) elif mapMatrix[i][j] == 2: screen.blit(rock, [x_pos, y_pos]) elif mapMatrix[i][j] == 3: screen.blit(road, [x_pos, y_pos]) x_pos += 16 y_pos += 16 x_pos = 0 def main(): """ calls functions to allow the game to run """ # variable declarations done = False # initialize pygame pg.init() # make screen object size = (1600, 900) screen = pg.display.set_mode(size) # set window caption pg.display.set_caption("Bandit King") #manages FPS clock = pg.time.Clock() #creates map mapMatrix = createMap(30, 30, 140, 20, 2) while not done: # --- main event loop for event in pg.event.get(): if event.type == pg.QUIT: done = True # --- game logic # --- drawing code showMap(screen, mapMatrix) # --- update screen pg.display.flip() # --- limit to 60 FPS clock.tick(60) #print("height: ", pg.display.Info().current_h, "width: ", pg.display.Info().current_w) pg.quit() if __name__ == "__main__": main()
    • By adambiser
      Hello all,
      I have teamed up with TheGameCreators for them to trial a Python version of AppGameKit in the form of a PYD file that makes AppGameKit commands available to Python 3.6 and greater.  Currently this PYD is compiled only for use with the Windows x86 version of Python.  It is a free, unlimited version of their commercial product, but it does show the AppGameKit logo for a few seconds on game startup and AppGameKit is mentioned in the window title when in windowed mode.  The PYD works with PyInstaller for easy distribution.
      If you haven't heard of AppGameKit, I would recommend looking over their website.  They also have documentation online and an active community forum.  I should point out that method names have been changed to follow PEP 8 naming conventions, so they will be similar but different from the online help.  I also had to make a few changes mentioned on the project's itch.io page.  There is also a PYI file there that can be used with PyCharm for easier access to the same information.
      As mentioned, this is a trial for them, but if there's a positive response they will extend the project and include a way of compiling an executable without the intro logo and window title text as well as support other OS.
      Please take a look and feel free to ask me any questions about it here or on the project's community forum on itch.io.
      AppGameKit for Python project page at itch.io: https://fascimania.itch.io/appgamekit-for-python
      Original announcement url: https://www.thegamecreators.com/post/announcing-appgamekit-for-python
    • By RidiculousName
      I want to make a random map generator in python 3, but I have no idea how to do it. Could someone recommend me a good starting point?
      What I want to make is a flat 2D overworld-map with roads, rivers, settlements, farmlands, forests, and plains.
      I don't want to model specific buildings. This is just for a game I'm making where I'd like the player to be able to travel from point to point.
  • Advertisement
  • Advertisement

PYGRID RPG - A Textual Interface RPG in Python!

Recommended Posts

Heya everyone!

Based on my post score I'm sure you can tell I'm new to this community. I lurked a little bit to get an idea for the community and make sure I didn't post this where it didn't belong.

Key Information

Language:

    Python 3.6

 

Open Source:

    Yes

 

Level of Programming Knowledge Applied:

    Beginner-Intermediate ... I use a couple packages and a fair amount of dictionary maintenance that might be daunting to a -brand-spanking-new- newbie.

 

Required Packages:

    Numpy

 

Git Repo:

     https://github.com/frawst/pygrid

A brief history

I'm a Psychology major out of Saskatchewan, Canada, who has always had a profound interest in games. All kinds, from simple pen and paper to the latest video release (Oblivion was like OMG WHAT!?) Anyways, I don't study programming often, I take the occasional Computer Science class just to stay fresh if I haven't been doing much coding lately. I've made a few little games in the past, nothing too spectacular. Space Infaders was my first project when I was 13, and since then I've made a few minor projects in GameMaker, and toyed around with educational text games.

The Contemporary

I recently realized I have been letting my gaming habits take control of my life, and decided I needed to stop. I've learned about addiction in my education, and part of that education taught me that one addiction must be replaced by another. Apparently that is very true. Since I stopped gaming 3 days ago I have spent nearly 24 hours developing this little text game that I dreamed up nearly 10 years ago after playing a basic little pen and paper game I found on the net.

What is my game?

My game is a text-based dungeon crawler RPG that runs either in your native command window, or through Python's IDLE interpreter. The recommended method is through a command window since that's where the graphical elements really shine.

What's the design philosophy?

As of the time I am writing this, there is no real design philosophy. I've made everything I originally dreamed up and have just been adding to it since. I may update this in the future if I decide to take it seriously.

Why are you posting this here?

To invite criticism. I'm interested in hearing what you guys think about the game, any ideas you might have for expansion, and any other thoughts you might have regarding the game itself. The code is incredibly stringy and I know it needs to be cleaned up, so if you have any direct recommendations for how to structure code like this in a way that is as legible as possible then I am ALL EARS. I know how to read it, and I know where everything is, but when I start thinking about making it easy for others to read I get lost. Furthermore, PEP-8 is not followed in the source at the time I'm writing this which makes things further messier. I will be PEP-ing it soon, I just want to get the FEATURES In there!

Furthermore, I also implore any of you who do try the game out and receive inspiration from it to Fork it and make your own additions and customizations! I'd love to see how other people create in the environment that I have built.

Alternatively, if you are neither interested in coding or giving feedback, I hope you might at least enjoy playing the game in it's current state! I am updating it at an alarming rate right now as it is in early development, but it is completely playable :)

The only requirements to get started contributing is to have an install of Python 3.6 with the Numpy package installed.

python pip install numpy

I would post the source code into this thread, but it's around 650 lines of code at the time I am writing this so I'll just have to supply the repo.

Repo: https://github.com/frawst/pygrid

 

Thank you in advance for your interest in my little project, and for any and all feedback that you might provide! I hope you enjoy playing the game :)

Share this post


Link to post
Share on other sites
Advertisement

  • Advertisement