Re: how to let a python class accept more than 1 instent going?

2020-11-09 Thread AudioGames . net Forum — Developers room : Turret via Audiogames-reflector


  


Re: how to let a python class accept more than 1 instent going?

Yeah, in Python classes, declare vars like that inside the constructor only.

URL: https://forum.audiogames.net/post/588079/#p588079




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: how to let a python class accept more than 1 instent going?

2020-11-09 Thread AudioGames . net Forum — Developers room : mohamed via Audiogames-reflector


  


Re: how to let a python class accept more than 1 instent going?

i found out what was the problem, but not sure why it will be a problem in the first placewhat i were trying to do is try to make something like bgt's key_hold class, so it gos like the followingimport luciaclass key_hold(object):    key_code = ""    key_flag = 0    repeat_time = 0    key_timer = lucia.utils.timer.Timer()    sett1 = 0    sett2 = 0    def __init__(self,key_code,sett1,sett2):        self.key_code = key_code        self.sett1 = sett1        self.sett2 = sett2        self.repeat_time = sett1    def pressing(self):        if not lucia.key_down(self.key_code):            self.repeat_time = 0            self.key_timer.restart()            self.key_flag = 0            return False        if self.key_timer.elapsed >= self.repeat_time:            self.key_timer.restart()            if self.key_flag == 0:                self.key_flag = 1                self.repeat_time = self.sett1                self.key_timer.restart()                return True            if self.key_flag == 1:                self.key_flag = 2                self.key_timer.restart()                self.repeat_time = self.sett2                return False            if self.key_flag == 2:                self.key_timer.restart()                return True            return True        return Falsethat was the broken one, but for some reason, when i did the followingimport luciaclass key_hold(object):    def __init__(self,key_code,sett1,sett2):        self.key_code = key_code        self.sett1 = sett1        self.sett2 = sett2        self.repeat_time = sett1        self.key_timer = lucia.utils.timer.Timer()        self.key_flag = 0    def pressing(self):        if not lucia.key_down(self.key_code):            self.repeat_time = 0#            self.key_timer.restart()            self.key_flag = 0            return False        if self.key_timer.elapsed >= self.repeat_time:            self.key_timer.restart()            if self.key_flag == 0:                self.key_flag = 1                self.repeat_time = self.sett1                self.key_timer.restart()                return True            if self.key_flag == 1:                self.key_flag = 2                self.key_timer.restart()                self.repeat_time = self.sett2                return False            if self.key_flag == 2:                self.key_timer.restart()                return True            return True        return Falsethe it fixed, and who doesn't understand the problem i were going to a while loop, and creating 2 instents or more of the key_hold class, and then adding if's to check if key_name.pressing() but the problem was, if 1 key returned true, other keys returns false no matter if they were up or down, but as i said, the other edit worked somehow.

URL: https://forum.audiogames.net/post/588055/#p588055




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: how to let a python class accept more than 1 instent going?

2020-11-08 Thread AudioGames . net Forum — Developers room : bhanuponguru via Audiogames-reflector


  


Re: how to let a python class accept more than 1 instent going?

please explain and give a peace of example or sample code that you used. and what did you expect and what it is happening?

URL: https://forum.audiogames.net/post/588009/#p588009




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: how to let a python class accept more than 1 instent going?

2020-11-08 Thread AudioGames . net Forum — Developers room : Turret via Audiogames-reflector


  


Re: how to let a python class accept more than 1 instent going?

I honestly don't get it, either. super() is for inheriting, not checking values, nonetheless in loops.

URL: https://forum.audiogames.net/post/587900/#p587900




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: how to let a python class accept more than 1 instent going?

2020-11-08 Thread AudioGames . net Forum — Developers room : visualstudio via Audiogames-reflector


  


Re: how to let a python class accept more than 1 instent going?

@6 first I thaught he means your point.when he said that his execution blocks, I replied and wrote about threading@1 and @3, what do you really mean?what do you want to do?what is the problem and what do you expect it to do?which solutions did you try and so on and so forth.

URL: https://forum.audiogames.net/post/587885/#p587885




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: how to let a python class accept more than 1 instent going?

2020-11-08 Thread AudioGames . net Forum — Developers room : stewie via Audiogames-reflector


  


Re: how to let a python class accept more than 1 instent going?

hey make sure that any method you have on a class has self as the first parameter (the name technically doesn't matter, but the convention is self). This value (self) is used to refer to the class (self.somevar, etc). for exampleclass SomeClass:    def __init__(self, name, x, y):        #assign stuffinstance = SomeClass("name", 0, 1) #Notice how you only call the method with 3 parameters, not 4 but when you declare the method you use 4

URL: https://forum.audiogames.net/post/587866/#p587866




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: how to let a python class accept more than 1 instent going?

2020-11-08 Thread AudioGames . net Forum — Developers room : stewie via Audiogames-reflector


  


Re: how to let a python class accept more than 1 instent going?

hey make sure that any method you have on a class has self as the first parameter (the name technically doesn't matter, but the convention is self). This value (self) is used to refer to the class (self.somevar, etc). for exampleclass SomeClass:    def __init__(self, name, x, y):        #assign stuff

URL: https://forum.audiogames.net/post/587866/#p587866




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: how to let a python class accept more than 1 instent going?

2020-11-08 Thread AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector


  


Re: how to let a python class accept more than 1 instent going?

You aren't being clear at all about your problem.  I don't think any of us fully understand what you're trying to do or how it is going wrong.The first step to being a successful programmer is learning to organize your thoughts.  I suggest that you think about your question, figure out what we need to know for you to explain your problem, and then figure out how to say it coherently.  As things stand, we know things you've tried but not why you're trying them, and your posts aren't really explaining anything other than that you're frustrated.

URL: https://forum.audiogames.net/post/587857/#p587857




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: how to let a python class accept more than 1 instent going?

2020-11-08 Thread AudioGames . net Forum — Developers room : visualstudio via Audiogames-reflector


  


Re: how to let a python class accept more than 1 instent going?

@3, in this way, you need to use a thread (thats advanced, at least think about other stuff first)

URL: https://forum.audiogames.net/post/587849/#p587849




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: how to let a python class accept more than 1 instent going?

2020-11-08 Thread AudioGames . net Forum — Developers room : mohamed via Audiogames-reflector


  


Re: how to let a python class accept more than 1 instent going?

i do have a class, inside of it, i have values which i will use in a function, it works fine, but problem is, when i have 2 or more classes and i call both of them in the while loop to check if the function is working and for it to return the value. but problem is, when 1 function returns a value, the other freezes till the other one is done.

URL: https://forum.audiogames.net/post/587847/#p587847




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: how to let a python class accept more than 1 instent going?

2020-11-08 Thread AudioGames . net Forum — Developers room : Lucas1853 via Audiogames-reflector


  


Re: how to let a python class accept more than 1 instent going?

I don't understand what you're trying to do.

URL: https://forum.audiogames.net/post/587841/#p587841




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector