(If I try to use while loop the game crashes) If event.key = pg.K_z and pg.key.get_mods() & pg.KMOD_LCTRL:īasically, I want to enter a while loop and stay there WHILE I keep clicking, in order to gather all the rectangles into the list and then append it into the main entity list, however this does not enter a while loop and each time I draw it appends each new entity with a single rectangle and not a series of rectangles. For this I am using a stack (deque) from collections and what I also did was to create an Object called DrawEntity, which has an attribute of a list of rectangles (pygame class) because I don't want to save every pixel that I draw, but only one 'brushstroke' and not the components that make him (little ractangles make a brushstroke) however, I don't know how to insert to the main DrawEntity list which will save those entities in the queue for each brushstroke and not for each rectangle. I am trying to remember previous drawings to implement Ctrl-Z (Undo) and (Redo).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |