Page 3 of 3
Re: Sumer is icumen in
Posted: Fri Jul 22, 2016 1:57 pm
by richmond62
are only 43 lines of code to write!
Err: after the 5,500 lines of code in each of 1200 objects in my
Devawriter Pro I have metamorphosised
into the ultimate minimalist; and 43 lines makes me feel fairly nervous.
Re: Sumer is icumen in
Posted: Fri Jul 22, 2016 3:40 pm
by [-hh]
Richmond wrote:... I have metamorphosised into the ultimate minimalist ...
Accepted. But then I wonder why your rawkeydown handler from above has 100 lines and not 15?
Re: Sumer is icumen in
Posted: Fri Jul 22, 2016 4:02 pm
by richmond62
I wonder why your rawkeydown handler from above has 100 lines and not 15?
Cough!
Because, if you look at them closely you will see that the vast majority of those lines are essentially
reduplicated
CASE things.
In fact: my code is hopelessly
inefficient, and instead of a tedious set of
CASE statements
it should calculate the
width and
height of the pseudo-parabolic
path based on the
angle of elevation
of the cannon.
The nature of my code is the way it is because I have opted to use a
graphic rectangle with a series of
backPattern
images of a cannon at various angles of elevation. The reason I did this is because:
1. I couldn't be bothered to churn out 90 images for each of 90 degrees of elevation.
2. Every time I did a
ROTATE or
SET THE ANGLE with my cannon I ended up with a serious
case of the "fuzzy wuzzies".
- fuzzyWuzzies.png (6.96 KiB) Viewed 11449 times
Re: Sumer is icumen in
Posted: Fri Jul 22, 2016 4:20 pm
by [-hh]
I didn't mean the math, you have good reasons to simplify the procedure.
And I didn't mean at all your code to be 'inefficient', simply to write it down more "minimalistic". The word was 'pushing' me.
Code: Select all
on rawKeyDown RK
global POZZ
if RK is not among the items of "65308,65309" then pass rawkeydown
set backPattern of grc "gun" to the id of img ("gun" & POZZ)
if RK is 65309 then put max(1,min(8,1+POZZ)) into POZZ
else put min(8,max(1,-1+POZZ)) into POZZ
put line POZZ of ("860,240,541,633" &cr& "810,300,513,590" &cr& \
"750,360,477,546" &cr& "690,420,442,507" &cr& "630,480,408,467" &cr& \
"570,540,368,434" & "510,600,323,407" &cr& "450,660,282,365") into L
set width of grc "pathX" to item 1 of L
set height of grc "pathX" to item 2 of L
set loc of grc "pathX" to item 3 to 4 of L
end rawKeyDown
But never mind, this is secondary. Once again:
Very cool and useful collection. Thank you very much.
Re: Sumer is icumen in
Posted: Sat Jul 23, 2016 6:14 am
by RogGuay
You can probably get exactly what you need from my Phun Physics stack from RevOnline or what’s now known as Sample Stacks.
Cheers,
Roger
Re: Sumer is icumen in
Posted: Sat Jul 23, 2016 10:18 am
by richmond62
Thanks, Roger.
But, to be honest, all the stacks that are here are never meant to be perfected; they are meant for my Livecode Summer School pupils to
play with and get headaches, and, possibly, improve a small bit.
On a personal basis (nothing to do with the classes) I am not very happy with having to use a half ellipse as a fake parabola;
but cannot get my head around some relatively simple way to let the points of a parabola in a listField.
Re: Sumer is icumen in
Posted: Sun Jul 24, 2016 4:35 pm
by RogGuay
On a personal basis (nothing to do with the classes) I am not very happy with having to use a half ellipse as a fake parabola;
but cannot get my head around some relatively simple way to let the points of a parabola in a listField.
Well that's what I meant to imply. You can get the code for generating the actual parabolic curve of a projectile from Phun Physics. It involves a little math which you can certainly handle and maybe even an acceptable amount for your students?
HTH
Re: Sumer is icumen in
Posted: Sun Jul 24, 2016 8:00 pm
by richmond62
an acceptable amount for your students
Well; first off; I don't have any students on my Summer courses: they are all school children; pupils.
Most of these children are between 9 and 10 and would not know a conic section if it was standing right in front of them.
2 16 year olds who are not on the course, but are doing a Summer class in Upper-Intermediate English, and attend
the "Mathematical High School" here, were unable to explain to me the difference between a parabola and a
hyperbola; and, certainly, found it very difficult indeed to see how I could have generated a set of points for half an
ellipse using sines and cosines.
Either I am going senile or my cynicism about educational standards in Bulgaria is not misplaced.
Re: Sumer is icumen in
Posted: Tue Jul 26, 2016 8:38 pm
by richmond62
It's that time again; when children begin working on their final projects, and, perhaps, predictably, they
tend to fall into fairly standard categories.
Here's my "stupid shooter".
https://www.dropbox.com/s/fp4tqqtn4ly1t ... e.zip?dl=0
Re: Sumer is icumen in
Posted: Wed Jul 27, 2016 3:59 pm
by richmond62
Re: Sumer is icumen in
Posted: Thu Jul 28, 2016 8:03 pm
by richmond62
So long and thanks for all the fish.