Search found 6 matches

by bats
Tue Dec 20, 2016 4:49 pm
Forum: Ren'Py Questions and Announcements
Topic: Game loop within renpy for playing mini-games?
Replies: 3
Views: 2470

Re: Game loop within renpy for playing mini-games?

Hm, even with turn-based games, how is the game supposed to update itself? Do I create a label and then jump to it over and over again?

Like this possibly?

Code: Select all

label doit:
    show screen map
    $ map.update(...)
    if notQuit: 
        jump doit
But this seems really slow.
by bats
Mon Dec 19, 2016 10:01 pm
Forum: Ren'Py Questions and Announcements
Topic: Game loop within renpy for playing mini-games?
Replies: 3
Views: 2470

Game loop within renpy for playing mini-games?

Generally a game follows this pattern: while notQuit: game.update() userInput.process() Where the game gets updated and the user inputs gets processed at each iteration. With renpy, it handles the main game loop and inputs. If I want to add some super mario-like gameplay in between the visual novel ...
by bats
Mon Dec 19, 2016 12:54 pm
Forum: Ren'Py Questions and Announcements
Topic: Cannot import third-party lib numpy
Replies: 1
Views: 973

Cannot import third-party lib numpy

I tried to import numpy lib: pip install --target game/python-packages numpy Collecting numpy Using cached numpy-1.11.3-cp27-cp27mu-manylinux1_x86_64.whl Installing collected packages: numpy Successfully installed numpy-1.11.3 But when I import it I get an error: init python: import numpy as np Erro...
by bats
Sun Dec 18, 2016 11:07 pm
Forum: Ren'Py Questions and Announcements
Topic: How to load a tilesheet?
Replies: 8
Views: 1183

Re: How to load a tilesheet?

Hm, okay I tried to update @Divona code with @nyaatrap suggestions: label start: show screen doit e "rendered" init python: def tile(x, y): return LiveCrop((32*x, 32*y, 32, 32), "test.png" ) screen doit(): for y in xrange(100): for x in xrange(100): add tile(0,0): xpos 32 * x ypo...
by bats
Sun Dec 18, 2016 2:27 pm
Forum: Ren'Py Questions and Announcements
Topic: How to load a tilesheet?
Replies: 8
Views: 1183

Re: How to load a tilesheet?

@nyaatrap Can you give a code sample? I don't quite understand how I just started learning renpy today, so I didn't know blit was slow. In other engines, normally I would do something like build a quad, load the image as texture, then clip it and apply to the quad. Divona's way of doing it sounds li...
by bats
Sun Dec 18, 2016 4:44 am
Forum: Ren'Py Questions and Announcements
Topic: How to load a tilesheet?
Replies: 8
Views: 1183

How to load a tilesheet?

I have a tilesheet that has 16x16 grids that define 256 different types of terrain. How can I render the individual terrains through blit() ? I see that renpy has renpy.load_image() , but I'm unsure how to get renpy to then only render clips of the image. Most examples I've seen usually load individ...