text game

Creating Games? Developing something for fun?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
margu
Posts: 15
Joined: Sat Apr 20, 2013 12:59 pm

text game

Post by margu » Sat Apr 20, 2013 1:03 pm

how can i create a text game?
when i was using visual basic on windows i wrote
if field.text = "hello" then show window2
but i don't know how to do this on live code
i tried this but doesn't work
if text into field is "hello" then open card id 1010

help me.
thank

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am
Location: Bordeaux, France

Re: text game

Post by Dixie » Sat Apr 20, 2013 1:13 pm

Code: Select all

if fld 1 = "hello" then go card id 1010
be well

Dixie

margu
Posts: 15
Joined: Sat Apr 20, 2013 12:59 pm

Re: text game

Post by margu » Sat Apr 20, 2013 1:27 pm

thank, but don't work
i tried to put this string in the stack and in the field.
when i write hello in the field card 1010 doesn't open

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2718
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: text game

Post by jmburnod » Sat Apr 20, 2013 5:12 pm

Hi Margu,
when i write hello in the field card 1010 doesn't open
Yes
What do you want ?
1. Going to cd id 1010 when "hello" has written in the field ?
2. Going to cd id 1010 when "hello" has written in the field and the user clicked to a checkup btn ?

Best regard
Jean-Marc
https://alternatic.ch

margu
Posts: 15
Joined: Sat Apr 20, 2013 12:59 pm

Re: text game

Post by margu » Sun Apr 21, 2013 1:13 pm

i prefer that Going to cd id 1010 when "hello" has written in the field and the user clicked to a checkup btn.
but i'm okay also with the first choice.
thank

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am
Location: Bordeaux, France

Re: text game

Post by Dixie » Sun Apr 21, 2013 1:31 pm

Margu...

put this into the script of a field...

Code: Select all

on returnInField
   if the text of me = "Hello" then go card id 1010
end returnInField
or, if you want to do it by clicking on a button, put this into the script of a button..

Code: Select all

on mouseUp
   if the text of fld 1 = "hello" then go card id 1010
end mouseUp
Now, we have covered all your bases...:-)

Dixie

margu
Posts: 15
Joined: Sat Apr 20, 2013 12:59 pm

Re: text game

Post by margu » Mon Apr 22, 2013 6:51 pm

thank you man

Post Reply

Return to “Games”