[Python] Pygame 2D RPG

Поділитися
Вставка
  • Опубліковано 18 жов 2024
  • My proyect:
    www.mediafire.c...

КОМЕНТАРІ • 12

  • @rodak14
    @rodak14  12 років тому +1

    About the Tiled Map Editor, I use it to create my maps, put monsters and the map's collision, then I load these maps with "complex" function.
    :)

  • @rodak14
    @rodak14  12 років тому +1

    Exactly, i made a unique huge surface with each array of the map. My character remains at the screen's center while the map's surface is moving.
    To move the map so smothly, you only need to use "move_ip(speed_x, speed_y)" on its rectangle, where speed_x and speed_y are the current speed of my character.
    If the char is "walking" to the right, his "speed_x" will change to 2 pixels (my game), but the map needs to move in the opposite direction to make an effect of walking. Same with others dirs :)

  • @jeffberhow
    @jeffberhow 12 років тому

    This is magnificent. I'm trying to teach myself how to work with arrays to do this as well. How did you go about making it scroll so smoothly, keeping the character in the middle? Are you creating a huge surface and then moving the surface underneath?

  • @jeffberhow
    @jeffberhow 12 років тому +1

    Thanks so much for the response. How about the update process? Having such a huge matrix with image values updating must take a lot of processing power. Is there a way to only update portions that you need to update and keep the rest of the map static?
    Also, how do you organize your tiles for easy access? Do you use a tile manager like the Tiled Map Editor? I saw this on a Pygame video and it looked intriguing. I will try it out today.

  • @rodak14
    @rodak14  12 років тому

    The "update process" is just a function of my "class map", as the following:
    def update(screen, speed_x, speed_y):
    _self.rect.move_ip( - spd_x, - spd_y)
    _screen.blit(self.map_image, self.rect)
    My map is just a huge surface/image. I created a surface, then I draw on it (with "surface.blit()" ) each tile of the map, making a unique map surface. I just update this image, forgetting the tiles and all arrays. This is the most effective update process I know ( I´m still a beginner).

  • @rodak14
    @rodak14  12 років тому

    It's from scratch, so, this simple game takes a lot of work.

  • @nuvydeep
    @nuvydeep 9 років тому +1

    Hi xRodak! Beautiful game :) I was wondering if I could see the code for this game. I am interested in learning how to create my own RPG in Python and would love to use your reference code.

    • @rodak14
      @rodak14  9 років тому +3

      Nuvi Pannu Hi Nuvi. The code of this proyect is in the description of the video. I recommend you to see this code only if you are new in programming because the quality of this code is pretty bad. I coded this 'game' when I started learning python (my first programming languaje). So, if you are in that situation (or something similar), this code may help you. If you want to create a game with commercial purposes, this code is a really bad example to start.
      If I'm not wrong,u can start the game using test.py. I dont remember too much about the keyboard entries, but try with WASD, the arrows and F1, F2.
      The code in the description is an updated version. I have a latest video for this game in my channel:
      ua-cam.com/video/QCsBAHwXav0/v-deo.html
      Thanks for your interest in this game. Feel free to do everything u want with the code.

  • @casioyba
    @casioyba 5 років тому

    Was this all made from scratch or did you use any library?

  • @rodak14
    @rodak14  11 років тому

    My full proyect is now in the description of this video.
    Good luck ! U can run the game with Test.py

  • @jeffberhow
    @jeffberhow 12 років тому

    Do you use any pygame made libraries, or is this from scratch?

  • @rodak14
    @rodak14  11 років тому +1

    Hi friend, I am srry, I cant help you because i'm working in a new project on C++. But if you want, i can give you this code.