Page 2 of 2

Re: Hello - New Member

PostPosted: Fri Aug 02, 2013 7:28 am
by skydereign
The reason for this is the last two lines of your view's draw actor. You created boundaries for the first level, and haven't updated them for the second level. I'd suggest creating the boundaries as variables, that way you can do something like this.
Code: Select all
if(doorstate==2)
{
    tux.y = 1000;

    // essentially four variables to represent the top left and bottom right points
    tl_view_x = 0;
    tl_view_y = 800;
    br_view_x = 12000;
    br_view_y = 1400;
}


That way the last two lines you can switch out the numbers with those variables. Another thing to note is if you are having lots of levels, you need to set up some variable to hold what level you are in. That way you can easily organize the xy locations for each level. If you know about arrays, that could help as well.

Re: Hello - New Member

PostPosted: Fri Aug 02, 2013 8:01 am
by TimberDragon
Thanks so much for your help Skydereign i honestly do appreciate the time your taking for me :)

Can i have 2 variables in the if statement, such as

Code: Select all
if(doorstate==2 && Collision tux (Any Side of Door) //<---I think i seen some where "&&" was equal to "and" <--Look how professional i look now using the "//"  :D
switch(something)
{ // <-- Just so i remember to always do it X)
case 0
case1
case2
}

ok so maybe not THAT professional... but im learning X)

Re: Hello - New Member

PostPosted: Fri Aug 02, 2013 12:15 pm
by skydereign
You can use and as you mentioned, you can even use or ||. But unless you have a variable to determine if tux is colliding with any side of door that isn't going to work. But, if you understand how events work in gE, an alternative method will work as well. If that code is in the tux's collision event with the door, necessarily that condition will be true, and therefore you just need the single condition checking doorstate.

Re: Hello - New Member

PostPosted: Thu Aug 15, 2013 3:56 pm
by TimberDragon
Ok, i bailed out on the idea of all levels being in 1 .ged file, im going to use multiple dat files for the final version. Im just about ready to release another demo, its a lot nicer then it was :)

But before i do i want to make a super simple slide on ice tiles, ive search, slide,sliding,icey surface, ice and many other words but ive found nothing that i could truly understand... no big surprises there lol.

Is there a way i can use the collision>Top Side of block>script editor
Code: Select all
if(DEAD==0)

PhysicalResponse(MOVE_EVENT_ACTOR_ONLY, USE_CALCULATED_MASS, 1, 1, 0, 0);

switch(STATE)

{
   case 4:
   ChangeAnimation("Event Actor", "tuxstillright", FORWARD);
   STATE=0;
   break;

   case 5:
   ChangeAnimation("Event Actor", "tuxstillleft", FORWARD);
   STATE=1;
   break;
}



Is there a simple way to use PhysicalResponse to induce a little slide depending on which way the player is moving? But only on certain tiles.

Re: Hello - New Member

PostPosted: Fri Aug 16, 2013 11:18 am
by TimberDragon
Well ive uploaded the demo without the slippery ice

Latest Demo: Jimber2013 V0.2

Let me know what you think.

Re: Hello - New Member

PostPosted: Mon Aug 19, 2013 5:30 am
by skydereign
TimberDragon wrote:But before i do i want to make a super simple slide on ice tiles, ive search, slide,sliding,icey surface, ice and many other words but ive found nothing that i could truly understand... no big surprises there lol.

Here are some ways of doing this. The easy way is to create a state for sliding, and during those states, move the actor left or right a fixed amount (for instance put that in draw).

A similar method is to create a variable to represent sliding speed and use that to offset the player's x value. During the slide state, you can decrease the variable, to create the slow down effect. And when you collide with the ice and transition to the slide state, make sure to set that variable equal to the actor's xvelocity before using PhysicalResponse.

Another method is to use xvelocity instead of x for movement. This is a little tricky because of how xvelocity and PhysicalResponse conflict, but you can use the trick to prevent sticky walls in a similar way to bypass this.
Code: Select all
double x_vel = xvelocity;
PhysicalResponse(MOVE_EVENT_ACTOR_ONLY, USE_CALCULATED_MASS, 1, 1, 0, 0);
xvelocity = xvel; // notice this makes it so the xvelocity is set to what it was before the collision