trooper6 wrote:Prince Manic wrote:
Tried it at this part
Code: Select all
show Time
play stab "sounds/sfx-stab.wav"
- unless it should be by the character label I'm not sure I'll try something else, I have the phoenix Wright like screen shake so trying to get the sound working too.
1) Why are you indenting after "show Time" that doesn't make any sense to me. And I'm think that'll result in some sort of problem.
2) Why are you playing "stab"? If you note what I wrote:
sound is the name of the default sound effects channel...so why aren't you using that?
It's one of those effects from the game like they're shocked or something I figured it out it was this with the this as part of the code
Code: Select all
init:
python:
import math
class Shaker(object):
anchors = {
'top' : 0.0,
'center' : 0.5,
'bottom' : 1.0,
'left' : 0.0,
'right' : 1.0,
}
def __init__(self, start, child, dist):
if start is None:
start = child.get_placement()
#
self.start = [ self.anchors.get(i, i) for i in start ] # central position
self.dist = dist # maximum distance, in pixels, from the starting point
self.child = child
def __call__(self, t, sizes):
# Float to integer... turns floating point numbers to
# integers.
def fti(x, r):
if x is None:
x = 0
if isinstance(x, float):
return int(x * r)
else:
return x
xpos, ypos, xanchor, yanchor = [ fti(a, b) for a, b in zip(self.start, sizes) ]
xpos = xpos - xanchor
ypos = ypos - yanchor
nx = xpos + (1.0-t) * self.dist * (renpy.random.random()*2-1)
ny = ypos + (1.0-t) * self.dist * (renpy.random.random()*2-1)
return (int(nx), int(ny), 0, 0)
def _Shake(start, time, child=None, dist=100.0, **properties):
move = Shaker(start, child, dist=dist)
return renpy.display.layout.Motion(move,
time,
child,
add_sizes=True,
**properties)
Shake = renpy.curry(_Shake)
#
#
this was from the old cookbook wiki and I used this to replicate the shake from Phoenix wright this was clashing from the defined character at the end of this
Code: Select all
pw "{color=#ffffff}{font=phoenix_sans 2.ttf} {size=16}What You Seen was a Disslove like Effect from my game and it rendered her to me the sprites will be adjdusted to be on here bigger and fit on the screen{font}{/size}" with sshake
how I could add in the sound to the shake code and make it work once I've defind it with a dollar sign?