Okay, so assuming you have two different types of points only, here is code that allows you to show both points at the same time (you use two different screens). Also, since I'm not convinced you need two different classes, I combined PointKeeper and PointFucker into one class, PointLocker. You just need to specify what sort of point you want to adjust.
Code: Select all
# Declare characters used by this game.
define e = Character('Eileen', color="#c8ffc8")
default pl = PointLocker()
transform PointAnimation(loc):
# These control the position.
xpos loc
ypos .015
alpha 0
# These control the actions on show and hide.
on show:
parallel:
linear .25 alpha 1.0
parallel:
ease .75 ypos 0.05
on hide:
parallel:
linear .5 alpha 0.0
parallel:
ease .75 ypos 0.0
screen Outer_dpScreen(message):
use InnerScreen(message, 0.1)
timer 3.0 action Hide("Outer_dpScreen")
screen Outer_npScreen(message):
use InnerScreen(message, 0.5)
timer 3.0 action Hide("Outer_npScreen")
screen InnerScreen(message, loc):
text message at PointAnimation(loc)
screen Points():
frame:
xalign 1.0
yalign 0.0
vbox:
text "Points:"
text "Didac: [pl.dp]"
text "Neus: [pl.np]"
init python:
class PointLocker(object):
def __init__(self):
self.dp = 0
self.np = 0
def ch_pts(self, type, num):
if num >= 0:
start = "{color=#6abd45}{size=30}+"
else:
start = "{color=#ed2024}{size=30}"
end = "{/size}{/color}{color=#ffee2e}{size=12}%s{/size}{/color}{image=images/menu/heart_icon.png}" % ("DIDAC" if type == 'dp' else "NEUS")
message = "%s %d %s" % (start, num, end)
if type == "dp":
self.dp += num
else:
self.np += num
renpy.show_screen("Outer_{}Screen".format(type), message)
# The game starts here.
label start:
show screen Points()
e "Testing the first point change."
$pl.ch_pts("dp", 5)
$pl.ch_pts("np", -4)
e "Testing the second point change."
$pl.ch_pts("dp", 5)
$pl.ch_pts("np", -4)
e "Test over."
return
One last thing. What are Dídac points and Neus points by the way? Are they two very different sorts of points, like Money Points and Humor Points, or are they the just a bonus or a penalty to one point total...so for example love points is the total, and you get a bonus point or a penalty point to the love points? Because if that is the case, the bonus points are always positive and the penalty points are always negative, then you can simplify your code even further:
Code: Select all
# Declare characters used by this game.
define e = Character('Eileen', color="#c8ffc8")
default lp = LovePoints()
transform PointAnimation(loc):
# These control the position.
xpos loc
ypos .015
alpha 0
# These control the actions on show and hide.
on show:
parallel:
linear .25 alpha 1.0
parallel:
ease .75 ypos 0.05
on hide:
parallel:
linear .5 alpha 0.0
parallel:
ease .75 ypos 0.0
screen Outer_dpScreen(message):
use InnerScreen(message, 0.1)
timer 3.0 action Hide("Outer_dpScreen")
screen Outer_npScreen(message):
use InnerScreen(message, 0.5)
timer 3.0 action Hide("Outer_npScreen")
screen InnerScreen(message, loc):
text message at PointAnimation(loc)
screen LoveScreen():
frame:
xalign 1.0
yalign 0.0
text "Love Points: [lp.love]"
init python:
class LovePoints(object):
def __init__(self):
self.love = 0
def ch_pts(self, add, num):
if add:
start = "{color=#6abd45}{size=30}+"
else:
start = "{color=#ed2024}{size=30}"
end = "{/size}{/color}{color=#ffee2e}{size=12}%s{/size}{/color}{image=images/menu/heart_icon.png}" % ("DIDAC" if add else "NEUS")
message = "%s %d %s" % (start, num, end)
if add:
self.love += num
renpy.show_screen("Outer_dpScreen", message)
else:
self.love -= num
renpy.show_screen("Outer_npScreen", message)
# The game starts here.
label start:
show screen LoveScreen()
e "Testing the first point change."
$lp.ch_pts(True, 5)
$lp.ch_pts(False, 4)
e "Testing the second point change."
$lp.ch_pts(True, 5)
$lp.ch_pts(False, 4)
e "Test over."
return
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Check out My Clock Cookbook Recipe:
http://lemmasoft.renai.us/forums/viewto ... 51&t=21978