if

Stuck? This is the place to go to get and give help.

if

Postby snivy1999 » July 6th, 2012, 8:42 pm

you know the if function.
how do you do if a pressed a.(eg. the stylus held one:

If,Stylus.Held,this

please help
Last edited by snivy1999 on July 7th, 2012, 9:22 am, edited 1 time in total.
snivy1999
 
Posts: 27
Joined: May 28th, 2012, 4:19 pm

Re: if

Postby Buck_7 » July 6th, 2012, 8:55 pm

What do you mean if pressed on the right box?

For the If actions, you can use:

Stylus.Released, Stylus.Held, Stylus.Newpress
Pad.Newpress.Up (Down, Left & right) also Pad.Anykey
Upcoming games I'm working on:
  • Minecraft2DS
  • Bow Man DS
  • Bird poo!
------------------------------------------------------------------------
COOL LOOK 3D portal port for DS! http://drunkencoders.com/2013/01/dstal-advance/
needMusic?needHelp?Ask.
User avatar
Buck_7
 
Posts: 961
Joined: February 19th, 2011, 1:44 am

Re: if

Postby Foxi4 » July 6th, 2012, 9:51 pm

You use the Action and input a condition, like:

AValue==AValue2

You can also use the name of the value alone, for example Pad.Newpress.Up and the compiler will interpret it as:

Pad.Newpress.Up!=0 (not equal to zero)

There are numerous conditions you could use, just read up on operators in C.
Current Projects:

FalloutDS: Postponed until proper libraries are created, 10%
Foxi_Lib: A completely revised version of NitroSprites[FINAL], NitroBackgrounds and NitroText[FINAL], 40%
Foxi4
 
Posts: 1114
Joined: December 31st, 2010, 3:25 am

Re: if

Postby snivy1999 » July 7th, 2012, 10:33 am

ok how do you do it for:
a, b, x and y.
snivy1999
 
Posts: 27
Joined: May 28th, 2012, 4:19 pm

Re: if

Postby Buck_7 » July 7th, 2012, 5:28 pm

Forgot to mention;

Same thing as well. Pad.Newpress(or Held).X or Y or L or R or Start or Select.
Upcoming games I'm working on:
  • Minecraft2DS
  • Bow Man DS
  • Bird poo!
------------------------------------------------------------------------
COOL LOOK 3D portal port for DS! http://drunkencoders.com/2013/01/dstal-advance/
needMusic?needHelp?Ask.
User avatar
Buck_7
 
Posts: 961
Joined: February 19th, 2011, 1:44 am

Re: if

Postby Nobody » July 7th, 2012, 8:32 pm

Status of button:
Pad.Newpress
Pad.Held
Pad.Released

Button:
B, X, Y, A, Up, Down, Left, Right, ect.
and i think there is one called "Any" or "any" or something like that, but i have to look that one up

So we'd compile a statement like so: If Pad.Newpress.B
Feel free to ask me for help. I'm on the forum a lot.

Recent Projects:
Crafters DS (Minecraft 2D Clone!) viewtopic.php?f=13&t=3082 (latest project!)
The Living Dead - viewtopic.php?f=13&t=1582
Mario Craft - viewtopic.php?f=8&t=1736 (Most Popular!)
Spawn Zombies - viewtopic.php?f=13&t=3444 (Newest)
User avatar
Nobody
 
Posts: 1942
Joined: February 14th, 2011, 12:08 am
Location: United States of America

Re: if

Postby Buck_7 » July 7th, 2012, 9:06 pm

Yeah, there is, as I've already posted in the 1st.

Pad.Newpress.Anykey or Pad.Held Anykey

I don't think there's one for the power button though :P
Upcoming games I'm working on:
  • Minecraft2DS
  • Bow Man DS
  • Bird poo!
------------------------------------------------------------------------
COOL LOOK 3D portal port for DS! http://drunkencoders.com/2013/01/dstal-advance/
needMusic?needHelp?Ask.
User avatar
Buck_7
 
Posts: 961
Joined: February 19th, 2011, 1:44 am


Return to Help

Who is online

Users browsing this forum: No registered users and 2 guests