Mobile Maze Application for on Android devices

Creating Games? Developing something for fun?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

laurabar55
Posts: 26
Joined: Tue Mar 18, 2014 11:10 pm

Re: Mobile Maze Application for on Android devices

Post by laurabar55 » Wed Apr 09, 2014 5:58 am

Hi, so I got rid of the intersect part and just had the repeat code in there, but it got all locked up.
should I do something like this then, or are you telling me to get ride of the intersect idea all together?

if intersect(image "maze", image "p3", "opaque pixels") then
set the left of group "pie" to the left of group "pie" - 2
repeat until not intersect(image "maze", image "p3", "opaque pixels")
add 1 to tMove
end repeat
end if


sorry if I am way off track. I am trying

laurabar55
Posts: 26
Joined: Tue Mar 18, 2014 11:10 pm

Re: Mobile Maze Application for on Android devices

Post by laurabar55 » Wed Apr 09, 2014 6:01 am

No, that doesn't work either. it still locked up.

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am
Location: Palo Alto

Re: Mobile Maze Application for on Android devices

Post by Simon » Wed Apr 09, 2014 6:08 am

YES!
followed by a
WOW!

Yes off track.

The code you started with is correct, I just was changing that -10
tMove has to do with "set the left..." to a small number and keep building it till it no longer intersects.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

laurabar55
Posts: 26
Joined: Tue Mar 18, 2014 11:10 pm

Re: Mobile Maze Application for on Android devices

Post by laurabar55 » Wed Apr 09, 2014 6:13 am

I tend to complicate things ... and make it harder than it actually is. Lol

Is this what you mean then?

if intersect(image "maze", image "p2", "opaque pixels") then
set the left of group "pie" to the left of group "pie" tMove
end if

laurabar55
Posts: 26
Joined: Tue Mar 18, 2014 11:10 pm

Re: Mobile Maze Application for on Android devices

Post by laurabar55 » Wed Apr 09, 2014 6:22 am

nope that doesn't work at all.

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am
Location: Palo Alto

Re: Mobile Maze Application for on Android devices

Post by Simon » Wed Apr 09, 2014 6:23 am

RATS RATS RATS!

OK you beat me!

if intersect(image "maze", image "p3", "opaque pixels") then
repeat until not intersect(image "maze", image "p3", "opaque pixels")
add 1 to tMove
set the left of group "pie" to the left of group "pie" - tMove
end repeat
end if

And where are my image names, how can I tell if it's moving in the correct direction?

I'm crap at teaching :x

Now I refuse to tell you any more until you explain what this line does:
repeat until not intersect(image "maze", image "p3", "opaque pixels")

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

laurabar55
Posts: 26
Joined: Tue Mar 18, 2014 11:10 pm

Re: Mobile Maze Application for on Android devices

Post by laurabar55 » Wed Apr 09, 2014 6:40 am

That line means that it is to repeat moving the marble to the left until the marble no longer intersects with the maze walls. That way if it keeps moving to the left it will not go through the wall.

is that the correct answer

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am
Location: Palo Alto

Re: Mobile Maze Application for on Android devices

Post by Simon » Wed Apr 09, 2014 6:56 am

Sure... I think.

How is it working?
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

laurabar55
Posts: 26
Joined: Tue Mar 18, 2014 11:10 pm

Re: Mobile Maze Application for on Android devices

Post by laurabar55 » Wed Apr 09, 2014 7:13 am

It work pretty good, but if it touches the wall for two long the marble jumps to a random location.

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am
Location: Palo Alto

Re: Mobile Maze Application for on Android devices

Post by Simon » Wed Apr 09, 2014 7:23 am

yeah, you have to limit the x,y so that it can't go past say +5 px. That will reduce the velocity, not perfect.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

laurabar55
Posts: 26
Joined: Tue Mar 18, 2014 11:10 pm

Re: Mobile Maze Application for on Android devices

Post by laurabar55 » Wed Apr 09, 2014 7:41 am

I know this is probably wrong, but would I do that like this?

if intersect(image "maze", image "p1", "opaque pixels") then
repeat until not intersect(image "maze", image "p1", "opaque pixels")
add 1 to tMove
pXAccel +5
set the right of group "pie" to the right of group "pie" - tMove
end repeat
end if

laurabar55
Posts: 26
Joined: Tue Mar 18, 2014 11:10 pm

Re: Mobile Maze Application for on Android devices

Post by laurabar55 » Thu Apr 10, 2014 12:51 am

Hi Simon,
so I fully get that you don't want to give me all the answers. but can you give me more of a hint on how to do the x and y so that it doesn't go through the walls. I know that thing I sent you doesn't work because I tested that, and i have tried a few other things with no luck.

thanks,

Laura

laurabar55
Posts: 26
Joined: Tue Mar 18, 2014 11:10 pm

Re: Mobile Maze Application for on Android devices

Post by laurabar55 » Thu Apr 10, 2014 5:51 am

if intersect(image "maze", image "p2", "opaque pixels") then
repeat until not intersect(image "maze", image "p2", "opaque pixels")
add 1 to tMove until tMove = +5
set the top of group "pie" to the top of group "pie" - tMove
end repeat
end if

then I tried this
if intersect(image "maze", image "p2", "opaque pixels") then
repeat until not intersect(image "maze", image "p2", "opaque pixels")
add 1 to tMove until y=5
set the top of group "pie" to the top of group "pie" - tMove
end repeat
end if

Can you let me know if any of these that I have done is on the right track?

Thank you :)

Laura

Post Reply

Return to “Games”