Conversation started Nov 29, 2013 at 0:00.
Nov 29, 2013 00:00
you mean def atPort():?
its more natural
yeah, then that would return true or false
in the Player class or out?
instead of setting the variable
Nov 29, 2013 00:01
i fail to see why that would be more natural..... can you show me what you mean?
like a sample method?
that depends
on what?
if anyone else would care to know if your 'player' reached a port.
Ummm.... maybe
Yeah
If he was at a port, the pirates (not implemented yet) would not be able to attack
well, in the future you would probably want to make it a state
like
 if not player.check_state('at port'):
    # attack
Nov 29, 2013 00:05
ah
hm
good idea
Nov 29, 2013 00:16
I am totally done with PHP for today
Tries to enable safe_mode
doesn't work.
Sup peoples
sup @Noctrine?
nm. just making all my stuff disposable.
gotta make GL delete stuff properly.
i am having so much trouble implementing turns.... I don't want to pause the whole loop, but.... how @Jovito?
Ugh need to get to a real machine
Nov 29, 2013 00:23
lol
@Noctrine SO TIME!
:P
if anyone wants to answer:
0
Q: How to implement turns while still executing the main loop?

TheProgramm3rI am creating a trading game in Python, and want to know how to implement turns without pausing the gameloop. I know that I will have to change the way movement is implemented, but how would I do that? Note: code can be reached here (May be old): http://pastebin.com/rZbCXk5i

haven't done this yet, but first thought is to use a queue
^ yep
turn is over? turnQueue.Enqueue(turnQueue.Dequeue());
aha! I finally figured out exactly what breaks intellisense in VS2012 and 2013.
if there's a syntax error in one file, and I change the name of something in another file, intellisense stops working.
or so it does for me, but it does it every time.
whoo, got render targets working! and it was actually pretty easy.
Nov 29, 2013 00:42
cool
@TheProgrammer why you're pausing the game in the first place?
wait, let me see your code
yeah
player.goodsNumber = int(input(">>>"))
yeah... that pauses the game.... meh
first of all, like I said, you should get rid of that console window
then, in that case you can just assume the player doesn't take anything until he says so.
that way everything keeps rolling
Nov 29, 2013 00:47
i will
wait... what?
say he reaches the port
player doesn't take anything until he says to?
kk
he reaches the port
unless you want him to decide how many goods he wants to take before taking off
yeah
i do
still, in that case you'd do something like this
if self.check_state('at port'):
    goods_taken = self.get_input()
    if goods_taken: self.goods += goods_taken
Nov 29, 2013 00:52
explain the check_state
never used it
then reset its state
that's just an example
can you show me the docs for the state thing?
link?
the main thing is that you should stop getting input from the command line
get it from pygame
yeah
i will
and the game won't pause anymore
say you have several options
1 - 2 goods
2 - 4 goods
3 - 6 goods
whatever
Nov 29, 2013 00:54
mhmm
then you could check
keys = pygame.key.get_pressed()
if keys["""KEY HERE"""]:
    add goods
ah
i capture the keys for arrow keys already
could add an if statement:
if keys["""KEYS HERE"""] and atPort == True:
that's okay, there's plenty of keys available
Nov 29, 2013 00:56
yep
OR better
if keys[key] and self.check_state('at port'):
or
if keys[key] and self.get_state() == 'at port':
whatever
yea
explain the check_state and get_state
never used those
that's just an abstraction
Nov 29, 2013 00:58
ah
yourself would code that
currently I do this
:D
btw
look at the comments on the question
Christain is being helpful, sort of
class Player(object):

    VALID_STATES = ['state1', 'state2', 'state3']

    # LOTS AND LOTS OF STUFF

    def check_state(self, state):
        if state in Player.VALID_STATES:
            return self.__state == state
so....
that means
that if a state is valid
it will return true or false?
and would I create another method for setting the state called set_state?
that's what the code says :P
yeah
checking for valid states as well
Nov 29, 2013 01:02
kk
okay, now I really got this renderbuffer thing working.
has not ignored your conversation so far
just felt odd butting into a conversation with my random thing
Nov 29, 2013 01:03
lol
@Jovito why the self.__state
what's the significance of the double __
pseudo private
oh
how will I keep track of which port I was at? I don't really want people to be able to "farm" the same port
I can't tell you everything, Pip. Think about it for a while and if you don't come up with an answer I'll help you.
thanks
should I just declare "atPortA" or "atPortB?"
hahaha
no
Nov 29, 2013 01:12
damn
:P
imagine if you had 5000 ports in your game
see the problem?
yeah
will I get stars for:
flixel is fucking gay!
:P
gotta go
see you tomorrow
 
Conversation ended Nov 29, 2013 at 1:21.