happyjustbecause wrote:Can you explain a good way on how to do the warp to the top?
happyjustbecause wrote:Also, how would I prevent there being an empty area (no rain), if the rain isn't infinite.
int i;
for(i=0;i<6;i++)
{
// something along these lines
CreateActor("rain", "rain", "(none)", "(none)", view.x, view.y-20+i*50, true);
}
happyjustbecause wrote:Would you have the strips of raindrops be vertical or horizontal?
happyjustbecause wrote:How can I have the rain follow the view?
happyjustbecause wrote:I can't just put x=view.x and y=view.y, because that doesn't allow for movement of the rain.
happyjustbecause wrote:If I want to have x and y movement of the rain, how can I make it so that the rain doesn't just warp all into the same place? I just think the rain may look better moving at a slight angle.
You can warp the rain back to the top of the view, relative to where the actor is. You know its xvelocity, yvelocity, and how tall the view is. With that, you can determine how far (in x) the rain was offset, reverse it, and set the y to above the view.
if(yscreen>view.height) // prevents out of vision event for left and right screen
{
yscreen = -20; // half the safe margin
xscreen -= xvelocity*((view.height+40)/yvelocity);
}
y_offset = -20; // half the safe margin
x_offset = 2*((height+40)/10); // same equation as the previous code
// just replaced xvelocity and yvelocity (can use defines or variables as well)
happyjustbecause wrote:But there is one issue I'm unsure on how to fix. When the view moves up because of the player jumping, the rain looks like it is slowing down it's velocity. And the same kind of thing happens when the view moves down as the player is falling, the rain starts traveling extremely quickly. Is there some way to have the velocity balance out with the view movement? Some way to make the rain look like it acts on its own, not affected by the movement of the view.
happyjustbecause wrote: I guess I could have a switch statement seeing if there are any rain actors present, or maybe I can check the visibility state?
switch(ActorCount("rain"))
{
case 0:
break;
default:
// play sound
break;
}
happyjustbecause wrote:I mention check the visibility state, because I don't want rain constantly going on, but I'm not sure how I would get rid of it and have it appear again, being in the same orientation, allowing for the safe margins and such.
happyjustbecause wrote:is there anyway I would be able to do that while it is playing, it is smoothly loopable, so would I have to just replay the sound when changing the volume?
if(RainOn==0)
{
VisibilityState("Event Actor", DONT_DRAW_ONLY);
VisibilityState("Rain", DONT_DRAW_ONLY);
EventDisable("Rain", EVENTALL);
EventDisable("Event Actor", EVENTALL);
}
else
{
VisibilityState("Event Actor", ENABLE);
VisibilityState("Rain", ENABLE);
EventEnable("Event Actor", EVENTALL);
EventEnable("Rain", EVENTALL);
PlayMusic2("data/Rain.ogg", SFX_Volume, 0, HIGH_PRIORITY_MUSIC);
}
happyjustbecause wrote:I added the wireframe region, but when the visibility state is changed for the wireframe region, it doesn't change it's child actor's visibility state. And the EventDisable doesn't affect the child actor.
happyjustbecause wrote:I'm trying to fix the sound effect, but when I put in the draw actor of the wireframe (<-- maybe you meant the rain actor?), it just sounds like it's playing the same sound effect constantly, like white noise almost.
happyjustbecause wrote:I want to have the RainOn variable that way I have an easy way to turn the rain on/off.
Users browsing this forum: No registered users and 1 guest