Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Modifying Class values
Post: RE: Modifying Class values

(Aug-05-2019, 09:52 PM)ichabod801 Wrote: self.level is an integer, which is immutable. Immutable data types are assign by value, which mean a copy is made. So level has the same value as self.level ...
Tridium Game Development 2 2,245 Aug-05-2019, 10:29 PM
    Thread: Modifying Class values
Post: Modifying Class values

Hello, again... You guys recently replied to my post: https://python-forum.io/Thread-Modifying-Classes, and it was of great help to me I was able to implement it and expand it for what I needed, So t...
Tridium Game Development 2 2,245 Aug-05-2019, 09:23 PM
    Thread: Modifying Classes
Post: RE: Modifying Classes

Thank you to everyone who replied here. I appreciate all the answers I've received and hope to learn from them and implement them into my project. I chose this project as the method I am going to te...
Tridium Game Development 4 6,776 Aug-03-2019, 05:41 PM
    Thread: Modifying Classes
Post: Modifying Classes

Hello, I am trying to better understand Classes. This time, I'm trying to modify Class attributes(? I think this is the correct term) using a function. Anyone got an explanation why this method isn'...
Tridium Game Development 4 6,776 Aug-02-2019, 11:44 PM
    Thread: Help with Classes and dictionaries
Post: RE: Help with Classes and dictionaries

(Jul-30-2019, 06:37 PM)Windspar Wrote: Example class Pool: def __init__(self, value): self.value = value self.max_value = value class Stats: def __init__(self, strength=0, d...
Tridium Game Development 3 2,404 Aug-02-2019, 09:10 PM
    Thread: Help with Classes and dictionaries
Post: Help with Classes and dictionaries

Hello, I'm am trying to convert my old game engine into a newer version that uses classes instead of just dictionaries. My goal is to add similar key values together from two different classes in ord...
Tridium Game Development 3 2,404 Jul-30-2019, 05:09 PM
    Thread: Dictionary help
Post: RE: Dictionary help

(Jul-29-2019, 09:31 AM)SheeppOSU Wrote: You can also do the following demonspawn = { 'level': 1 } demonspawn.update({ 'xpreward': round(demonspawn['level']*1.5), 'str': round(demonspawn...
Tridium General Coding Help 3 1,859 Jul-29-2019, 09:41 AM
    Thread: Dictionary help
Post: Dictionary help

Hi, I'm trying to understand dictionaries better. My problem is I'm trying to dynamically alter a value inside of a dictionary with a value inside that same dictionary. demonspawn = { 'level':...
Tridium General Coding Help 3 1,859 Jul-29-2019, 08:13 AM
    Thread: Python 3 Global Variable Help
Post: RE: Python 3 Global Variable Help

(Jul-28-2019, 06:48 PM)ThomasL Wrote: (Jul-28-2019, 07:49 AM)Tridium Wrote: I added the argument return line to the final line of function levelone(), and when I call it I still receive the error ...
Tridium Game Development 5 2,998 Jul-29-2019, 08:02 AM
    Thread: Python 3 Global Variable Help
Post: RE: Python 3 Global Variable Help

ThomasL, Thank you for your reply, I added the argument return line to the final line of function levelone(), and when I call it I still receive the error that name is undefined, I was able to solve ...
Tridium Game Development 5 2,998 Jul-28-2019, 07:49 AM
    Thread: Python 3 Global Variable Help
Post: Python 3 Global Variable Help

Hi, I'm just learning python and I'm still an absolute beginner, but I've decided to try my hand at a choose your own adventure game. My goal is to to create a new global variable within a function in...
Tridium Game Development 5 2,998 Jul-28-2019, 03:24 AM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020