New games every week!
JSE - Odd Behaviour
26th October 2021  
I stumbled upon an odd quirk in JSE yesterday.


If you add too many arrays into a single command, it can end up confusing it.
I've not 100% tracked down a foolproof way to trigger it, though, and that makes it one of those frustratingly difficult to fix bugs.
Where, why and how it's happening, I'm not certain.

All I know is that it happened yesterday whilst coding something, so I naturally worked around it. Then when I went back to find/fix the issue, I'd forgetten what the original code was, and it hasn't happened again since.

Some days, working so fast is working against me!
I really oughta try and track that down, because it was also one of those "not obvious why it is/isn't working" bugs.
Definitely needs fixed.
.. Whatever it was!


Have a Wiggly Christmas Tree. (Click to respawn)
A couple of days ago on Twitter, Rudy van Etten (Pakz on SoCoder) was making a nice branching tree thing, so I pinched the idea and rewrote it in JSE for the fun of it.

// Wiggly Xmas Tree // by Jayenkai // Created 2021/10/24 // Graphics 512,512,1 #Const $MaxStems=250 #Const $Length=0 #Const $Angle=1 #Const $From=2 #Const $XPos=3 #Const $YPos=4 #Const $Rnd=5 Dim Tree($MaxStems,10) stem=0 Tree(stem,$Length)=10 Tree(stem,$Angle)=0 Tree(stem,$From)=-1 Tree(stem,$XPos)=0 Tree(stem,$YPos)=0 Tree(0,$XPos)=jscrw()/2+Sin(Tree(0,$Angle))*Tree(0,$Length) Tree(0,$YPos)=jscrh()-Cos(Tree(0,$Angle))*Tree(0,$Length) Repeat CLS if MouseDown() then stem=0 if stem<$MaxStems then b=stem-1 : if b<0 then b=0 t=stem-40 : if t<0 then t=0 f=Rand(t,b) if Tree(f,$YPos)>jscrh()*0.1 then stem=stem+1 Tree(stem,$Length)=Rand(24,48) Tree(stem,$Angle)=Rand(-45,45) Tree(stem,$From)=f Tree(stem,$XPos)=Tree(f,$XPos) Tree(stem,$YPos)=Tree(f,$YPos) Tree(stem,$Rnd)=Rnd(0.03,0.05) endif endif Tree(0,$XPos)=jscrw()/2+Sin(Tree(0,$Angle))*Tree(0,$Length) Tree(0,$YPos)=jscrh()-Cos(Tree(0,$Angle))*Tree(0,$Length) Line jscrw()/2,jscrh(),Tree(0,$XPos),Tree(0,$YPos) SetCol 50,180,50 for n=1 to stem windy=Sin(Mills()*Tree(n,$Rnd)+n*3)*0.3 f=Tree(n,$From) Tree(n,$Angle)=Limit(Tree(n,$Angle)+(windy*jRnd(0.4,1.4)),-45,45) Tree(n,$XPos)=SmoothTo(Tree(n,$XPos),Tree(f,$XPos)+Sin(Tree(n,$Angle)+Tree(f,$Angle))*Tree(n,$Length),8) Tree(n,$YPos)=SmoothTo(Tree(n,$YPos),Tree(f,$YPos)-Cos(Tree(n,$Angle)+Tree(f,$Angle))*Tree(n,$Length),8) Line Tree(f,$XPos),Tree(f,$YPos),Tree(n,$XPos),Tree(n,$YPos) if n mod 15==0 and n<stem then InkRot Tree(n,$Angle)*3,1,1;Star Tree(n,$XPos),Tree(n,$YPos)+7,12,6:SetCol 50,180,50 if n==$MaxStems then InkRot 80,1,1;Star Tree(n,$XPos),Tree(n,$YPos)-16,48,24:SetCol 50,180,50 next Flip Forever

Views 54, Upvotes 1
Daily Blog , Jse , Bugs
New games every week!
Site credits : Jayenkai made this.
(c) Jayenkai 2017 and onwards, site design Rychan. RSS feed
Blog - JSE - Odd Behaviour - AGameAWeek