Page 1 of 1

Game development: how to move to the next level

Posted: Sat May 30, 2020 1:23 pm
by kideveloper11
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

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

Posted: Sat May 30, 2020 2:37 pm
by dunbarx
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

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

Posted: Sat May 30, 2020 5:02 pm
by kideveloper11
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" | |

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

Posted: Sat May 30, 2020 5:23 pm
by dunbarx
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

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

Posted: Sun May 31, 2020 12:18 pm
by richmond62
Mazes:

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

About June 21, 2019.

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

Posted: Sun May 31, 2020 12:21 pm
by richmond62
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 2849 times