Small Problem need Pointers

Non-platform specific questions.

Small Problem need Pointers

Postby Turon » Sat Jun 23, 2012 7:17 pm

Now I actually think I have got nearly the right code, the user variable dir is set into dir = 1; for left and dir = 0 for right I used this for a fire ball shooting in a previous project,
but the challenge here is in Noseman the fire ball and noseman were separate actors this time it is the same actor.
now for instance a guy in the game presses a button activating a body posture in the same direction as the previous animation,
he lets go of the button and changes direction pressing the button again he finds it automaticly switched to the same direction.

Code: Select all
if(dir = 1;)
ChangeAnimation("Event Actor", "Bea Shoot left", NO_CHANGE;)
if
(dir = 0;)
ChangeAnimation('Event Actor",Bea Shoot Right", NO_CHANGE;)
Attachments
Demo.png
kind of like this!
Turon
 
Posts: 862
Joined: Sun Jan 24, 2010 5:23 pm
Score: 32 Give a positive score

Re: Small Problem need Pointers

Postby skydereign » Sat Jun 23, 2012 7:31 pm

The problem is your if statements. That isn't how you use them.
Code: Select all
if(var==1) // this checks if var is equal to 1
{
    // and if it is, it triggers this code
}

You want to use == instead of = because if you put a single equal, it will set the variable's value instead of check it.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Small Problem need Pointers

Postby Turon » Sun Jun 24, 2012 5:18 am

Thank you Skdereingn! :D
Turon
 
Posts: 862
Joined: Sun Jan 24, 2010 5:23 pm
Score: 32 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest