My Beetle has a Mental Problem

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
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9388
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

My Beetle has a Mental Problem

Post by richmond62 » Thu Jun 20, 2019 5:20 pm

I have a merry SVG widget of a beetle that is meant to
edge detect an arena in which it is confined . . .

[c.f. https://meetedison.com/barcodes/ ]

-
Beetle.png
-
But the widget does not stay inwith the heptagonal arena . . .
-
Yikes.png
Yikes.png (15.31 KiB) Viewed 3557 times
-
ALL the movement code is contained in the "ACTION" button.

You can align the widget via the arrowKeys on your keyboard.

Help Needed. 8)
Attachments
BOUNCE.livecode.zip
Here's the stack
(9.8 KiB) Downloaded 192 times

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9670
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: My Beetle has a Mental Problem

Post by dunbarx » Thu Jun 20, 2019 6:04 pm

Richmond.

Without exhaustive testing, the snippet in case "135":

Code: Select all

 subtract 20 from UD
            subtract 20 from LR
            move widget "Beetle" to LR, UD
causes the widget to pull out of the rect of the heptagon. Something about the loc of the widget when it is in that position, that does not come into play when oriented in other positions in other parts of the graphic. This likely confuses it when it is time to move on.

Don't pull back so readily. :wink:

Craig

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9388
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: My Beetle has a Mental Problem

Post by richmond62 » Thu Jun 20, 2019 6:15 pm

Don't pull back so readily.

Thank you.


Of course that could be interpreted as an extremely filthy remark. 8)

BUT . . .
case "135"
repeat until intersect (widget "Beetle", img "wall", 10)
add 10 to UD
add 10 to LR
move widget "Beetle" to LR, UD
end repeat
--subtract 20 from UD
--subtract 20 from LR
move widget "Beetle" to 200,200
set the angle of widget "Beetle" to 180
break
Just pushes the problem elsewhere:
-
Fioch.png
Fioch.png (12.03 KiB) Viewed 3529 times
I performed a similar exercise confining myself to angles of 0, 90, 180 and 270
and that problem never arose.
Last edited by richmond62 on Thu Jun 20, 2019 6:24 pm, edited 1 time in total.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9670
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: My Beetle has a Mental Problem

Post by dunbarx » Thu Jun 20, 2019 6:24 pm

Richmond.

In the real world, that is, the United States, "pull back" means nothing.

This is not to say I did not notice something of what you mentioned. I did indeed, as I wrote it.

Here we say "pull out", and it is always accompanied by "in time". Americans, sadly, are rarely on time, much less in it.

Craig

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9388
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: My Beetle has a Mental Problem

Post by richmond62 » Thu Jun 20, 2019 6:50 pm

In the real world, that is, the United States
Cripes, talk about National Hubris.

My younger son has just relocated from Philadelphia to Los Angeles (work), and says
that most people in the U.S.A. wouldn't know what the "real world" meant: complaining
because they cannot afford a car!

Bulgaria is just as 'real' (whatever 'real' means: I'm not entirely sure) as
any of the other 17 countries I've worked in (the U.S.A. being one of them).

Not, frankly, that I care very much for the 'real world', and have spent
the better part of my life lovingly carving my own private bubble . . . 8)

As far as I can work out the main difference between the U.S.A. and
Bulgaria is simply a matter of scale: your dumpsters are bigger for fatter dumpster divers to dig in,
your social problems are bigger, your Universities are bigger, your pay packets are bigger,
your medical charges are bigger . . . and so on.

Part of my fantasy is to get the 'Beetle' widget to behave itself . . .
-
bh.jpg

kdjanz
Posts: 300
Joined: Fri Dec 09, 2011 12:12 pm
Location: Fort Saskatchewan, AB Canada

Re: My Beetle has a Mental Problem

Post by kdjanz » Thu May 28, 2020 5:17 am

BOUNCE.livecode.zip
(10.17 KiB) Downloaded 159 times
So I've been reading old stuff and this caught my eye (like the maze problem) so I downloaded it for a look. After an hour of intense noveau gestaltic psychotherapy, I believe your beetle has had a breakthrough... it now backs away from the walls it hits just a little bit more so that the hind foot is not still touching the wall when it finds the new direction. To test the new aversion therapy (as per Clockwork Orange protocols) I created a new more random shape for the walls and it passed with flying colours again.

Take care of the poor old chap, will you please?

Kelly

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9388
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: My Beetle has a Mental Problem

Post by richmond62 » Thu May 28, 2020 9:33 am

intense noveau gestaltic psychotherapy
-
index.jpg
index.jpg (8.01 KiB) Viewed 2801 times
-
Wow: you're way ahead of me baby. 8)

Just as soon as I'm sitting comfortably in front of my 'main machine' up in the mountains, I'll have
a look at your work . . .

. . . currently 'down' in the Shitty (err . . . City) visiting my accountant and the tax office . . . sheer joy.

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”