Mobile Maze Application for on Android devices
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
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
			
			
									
									
						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
No, that doesn't work either. it still locked up.
			
			
									
									
						Re: Mobile Maze Application for on Android devices
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
			
			
									
									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
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
			
			
									
									
						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
nope that doesn't work at all.
			
			
									
									
						Re: Mobile Maze Application for on Android devices
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
 
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
			
			
									
									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
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
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
			
			
									
									
						is that the correct answer
Re: Mobile Maze Application for on Android devices
Sure... I think.
How is it working?
			
			
									
									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
It work pretty good, but if it touches the wall for two long the marble jumps to a random location.
			
			
									
									
						Re: Mobile Maze Application for on Android devices
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
			
			
									
									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
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
			
			
									
									
						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
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
			
			
									
									
						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
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
			
			
									
									
						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
