Game development: how to move to the next level

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
kideveloper11
Posts: 2
Joined: Sat May 30, 2020 10:51 am

Game development: how to move to the next level

Post by kideveloper11 » Sat May 30, 2020 1:23 pm

Hello, I'm developing an education app for kids and I can't figure out what code I need to type to make the submarine ask: "Is my path clear?", and if there is an object that is not hidden besides the background and the submarine and you press yes then it types "Incorrect" and how many objects are left.
but if there are no objects left*1 then it adds a point and goes to the next level, and if I press no and there are objects left then it types "correct" but it doesn't add a point


help please,


kid-developer

here's the code of one of the objects:

Code: Select all

global _gUserScore

on mouseUp
   PinkJellyfishQuestion
end mouseUp

 
on PinkJellyfishQuestion
   answer "Is my color pink?" with "Yes" or "No"
   
   if it is "Yes"
   then
      AddPoints
      answer "correct" with "yay"
      hide me
      save this stack
   else
      answer  "try again please"
      end if
      end PinkJellyfishQuestion


      on AddPoints
         add 1 to _gUserScore
         put _gUserScore into field "userScore"
      end AddPoints
*1the object becomes hidden when you answer correctly, and again besides the submarine and background

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10320
Joined: Wed May 06, 2009 2:28 pm

Re: Game development: how to move to the next level

Post by dunbarx » Sat May 30, 2020 2:37 pm

Hi.

If you are talking about moving an object (a "mouse"?) through a maze, there have been a few gadgets made by people on this forum. Perhaps they will chime in.

In general, if I was building such a thing from scratch, my "mouse" would test the top, bottom, left and right of each fixed barrier or obstacle, and see what the distance is between to front of that mouse. Decisions are then made as to which way to nudge. If you get trapped, reverse course and keep trying. This isn't harder than it sounds, but it is very much more involved than it sounds.



Craig

kideveloper11
Posts: 2
Joined: Sat May 30, 2020 10:51 am

Re: Game development: how to move to the next level

Post by kideveloper11 » Sat May 30, 2020 5:02 pm

I need to make my submarine ask a question and the question is supposed to be kinda like that:

"is my path clear?" | | "please try again"
| |
| if not -> |
| |
-> "no" "yes" | |

"is my path clear?" | | "correct"
| |
| if is -> |
| |
-> "no" "yes" | |

"is my path clear?" | | "please try again"
| |
| if not -> |
| |
"no" -> "yes" | |

"is my path clear?" | | "now I can move!"
| |
| if is -> |
| |
"no" -> "yes" | |

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10320
Joined: Wed May 06, 2009 2:28 pm

Re: Game development: how to move to the next level

Post by dunbarx » Sat May 30, 2020 5:23 pm

Is your last post example in a certain format peculiar to another language? I do not understand the syntax.

In LiveCode there is a "Switch" control structure, which sort of seems similar in form:

Code: Select all

switch
  case condition1
    do someStuff
    break
  case condition2
    do otherStuff
    break
    ...
 end switch
Have you ever seen this? Can you translate, as best you can, your syntax, at least structurally, to this one?

Craig

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10099
Joined: Fri Feb 19, 2010 10:17 am

Re: Game development: how to move to the next level

Post by richmond62 » Sun May 31, 2020 12:18 pm

Mazes:

https://www.facebook.com/RMLCclasses/

About June 21, 2019.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10099
Joined: Fri Feb 19, 2010 10:17 am

Re: Game development: how to move to the next level

Post by richmond62 » Sun May 31, 2020 12:21 pm

First sort out your edge detection . . .

Then come back and ask questions about how to get your submarine to 'speak'. 8)
-
YSS.jpg
YSS.jpg (13.84 KiB) Viewed 2847 times

Post Reply