Forums

Off Topic Chat Lounge Thread is sticky

Quick find code: 23-24-312-63626936

Puppy Fren

Puppy Fren

Posts: 1,249 Mithril Posts by user Forum Profile RuneMetrics Profile
Anarya said :
Jack Flac said :
Basic data management at first, which was okay. It's what's pythons built for. But I ended up having to force build a game engine with it, which really wasn't fun. The libraries are there, but past a certain point, you're basically fighting with it to get it to do anything.

I don't know. 100-200 lines of code, for something I can write in c++ or c# in just 10-20, I can do it, but it isn't really fun.
Fair enough. Games engines definitely fall in the category of things I wouldn't touch with a 10 foot pole in Python. When runtime is critical, it's probably good to reach for something lower level.

Also, I really, truly, genuinely hate to be that guy, but you might want to look into list comprehensions. You could probably rewrite your spritestrip program into ~15 lines of code if you used them instead of hard-coding all those crops, renames, and loops.
https://docs.python.org/3/tutorial/datastructures.html?highlight=comprehension#list-comprehensions


Yeah, I don't want to really get into it, but having someone who's obviously learning the language for the first time talk about "how many more lines Python takes to do things than other lower level languages" is pretty silly. :)
*
´¨)
¸.
*
´
(¸.
*
Puppy Fren ~ Fren of Puppies Everywhere
:)

30-Sep-2017 16:32:58

Jack Flac
Feb Member 2022

Jack Flac

Posts: 6,207 Rune Posts by user Forum Profile RuneMetrics Profile
Icy Spring said :
Don't take this the wrong way, but your code is clearly written by a novice. Duplicated effort (compileRows recomputes work done in makeSprites), two for-loops doing a single task instead of a single for-loop doing two tasks, manually enumerated for-loops (1*width, 2*width, ..., name1, name2, ...), and having your Animation class take a billion arguments seems like an awkward design.

Do you have any C++ code for comparison? Also, it's kinda unfair to make generalizations about a language based on your experience with some random game engine's interface...
compileRows and makeSprites have different functions.

makeSprites is strictly for interacting with the game engine. Ren'py has some odd built in commands you have to incorporate at times to get it to work.
Leader of The Enemy ||
The opposite of Justice is simply another Justice. What is Evil is subjective to each person.
YOU
are their evil

30-Sep-2017 16:37:52

Jack Flac
Feb Member 2022

Jack Flac

Posts: 6,207 Rune Posts by user Forum Profile RuneMetrics Profile
Puppy Fren said :
Anarya said :
Jack Flac said :
Basic data management at first, which was okay. It's what's pythons built for. But I ended up having to force build a game engine with it, which really wasn't fun. The libraries are there, but past a certain point, you're basically fighting with it to get it to do anything.

I don't know. 100-200 lines of code, for something I can write in c++ or c# in just 10-20, I can do it, but it isn't really fun.
Fair enough. Games engines definitely fall in the category of things I wouldn't touch with a 10 foot pole in Python. When runtime is critical, it's probably good to reach for something lower level.

Also, I really, truly, genuinely hate to be that guy, but you might want to look into list comprehensions. You could probably rewrite your spritestrip program into ~15 lines of code if you used them instead of hard-coding all those crops, renames, and loops.
https://docs.python.org/3/tutorial/datastructures.html?highlight=comprehension#list-comprehensions


Yeah, I don't want to really get into it, but having someone who's obviously learning the language for the first time talk about "how many more lines Python takes to do things than other lower level languages" is pretty silly. :)
Lets see. I've spent at least two years in python, and nearly a year now in C#. Have also spent the past 3 months with C++.
Leader of The Enemy ||
The opposite of Justice is simply another Justice. What is Evil is subjective to each person.
YOU
are their evil

30-Sep-2017 16:49:22

Jack Flac
Feb Member 2022

Jack Flac

Posts: 6,207 Rune Posts by user Forum Profile RuneMetrics Profile
Anarya said :
Jack Flac said :
Basic data management at first, which was okay. It's what's pythons built for. But I ended up having to force build a game engine with it, which really wasn't fun. The libraries are there, but past a certain point, you're basically fighting with it to get it to do anything.

I don't know. 100-200 lines of code, for something I can write in c++ or c# in just 10-20, I can do it, but it isn't really fun.
Fair enough. Games engines definitely fall in the category of things I wouldn't touch with a 10 foot pole in Python. When runtime is critical, it's probably good to reach for something lower level.

Also, I really, truly, genuinely hate to be that guy, but you might want to look into list comprehensions. You could probably rewrite your spritestrip program into ~15 lines of code if you used them instead of hard-coding all those crops, renames, and loops.
https://docs.python.org/3/tutorial/datastructures.html?highlight=comprehension#list-comprehensions
Python 2 versus Python 3.
Leader of The Enemy ||
The opposite of Justice is simply another Justice. What is Evil is subjective to each person.
YOU
are their evil

30-Sep-2017 16:51:08

Quick find code: 23-24-312-63626936 Back to Top