Sumer is icumen in

Teaching software development? Using LiveCode to build your curriculum? This is the forum for you.

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

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

Re: Sumer is icumen in

Post by richmond62 » Fri Jul 22, 2016 1:57 pm

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 fell fairly nervous.

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1540
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

Re: Sumer is icumen in

Post by [-hh] » Fri Jul 22, 2016 3:40 pm

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?
shiftLock happens

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

Re: Sumer is icumen in

Post by richmond62 » Fri Jul 22, 2016 4:02 pm

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
fuzzyWuzzies.png (6.96 KiB) Viewed 1231 times

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1540
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

Re: Sumer is icumen in

Post by [-hh] » Fri Jul 22, 2016 4:20 pm

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.
shiftLock happens

RogGuay
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 57
Joined: Fri Apr 28, 2006 12:10 am

Re: Sumer is icumen in

Post by RogGuay » Sat Jul 23, 2016 6:14 am

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

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

Re: Sumer is icumen in

Post by richmond62 » Sat Jul 23, 2016 10:18 am

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.

RogGuay
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 57
Joined: Fri Apr 28, 2006 12:10 am

Re: Sumer is icumen in

Post by RogGuay » Sun Jul 24, 2016 4:35 pm

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

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

Re: Sumer is icumen in

Post by richmond62 » Sun Jul 24, 2016 8:00 pm

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.
halfAsixpence.png
Either I am going senile or my cynicism about educational standards in Bulgaria is not misplaced.

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

Re: Sumer is icumen in

Post by richmond62 » Tue Jul 26, 2016 8:38 pm

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".
shootOut.jpg
https://www.dropbox.com/s/fp4tqqtn4ly1t ... e.zip?dl=0

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

Re: Sumer is icumen in

Post by richmond62 » Wed Jul 27, 2016 3:59 pm


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

Re: Sumer is icumen in

Post by richmond62 » Thu Jul 28, 2016 8:03 pm

End.png
So long and thanks for all the fish.

Post Reply

Return to “Teaching with LiveCode”