-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|200|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-




Jayenkai

Keeping a value in a range?

15th January 2023

Yep.. And I remember having done that for my ''WhichWayDoIGo'' function in previous iterations.
... but do that repeatedly for every pixel on a texture, or every enemy on a tile map, or every wrapped vessel on an Orret Cha wraparound level, and yo*snip*


rockford

Keeping a value in a range?

15th January 2023

@Jay, depends if the values start above/below the range values. If they don't then my code would work straight off, if not then put in a FOR/NEXT loop and it would work.


Pakz

Keeping a value in a range?

15th January 2023

Screenshot'ed the function!


Jayenkai

Keeping a value in a range?

15th January 2023

Yeah, that'll do the trick. It's small and optimised, and .. as long as your code is ok working with negative numbers, should be just fine.
Especially if you're using it for values in textures and such, where you need to run really fast throu*snip*


Pakz

Keeping a value in a range?

15th January 2023

Well, I am going with the 3dSage raycasting method. That is only 1 line. I did another test and the lines drawn follow the right pattern with either positive or negative numbers given. :)
And I understand it is a wrap! Not a Clamp.
Edit: thanks for the h*snip*


Jayenkai

Keeping a value in a range?

15th January 2023

[jse]
a=15
IF a>10 THEN a=a-10
IF a<0 THEN a=a+10
Print a
a=25
IF a>10 THEN a=a-10
IF a<0 THEN a=a+10
Print a
a=25000
IF a>10 THEN a=a-10
IF a<0 THEN a=a+10
Print a
[/jse]


Jayenkai

AGameAWeek 2023

15th January 2023

Top tip for youtube thumbnails.
Take screenshot, crop it, ask StableDiffusion to re-render it ''Pixar style''
Job done!


rockford

Keeping a value in a range?

15th January 2023

IF a>10 THEN a=a-10
IF a<0 THEN a=a+10


rockford

QOTD - January 2023

15th January 2023

I don't have any real regrets, but I made some choices to get to where I am in my life. My life would most likely be very different had I made other choices at the time. Would my life have been better or worse? I'll neve know.


Jayenkai

Keeping a value in a range?

15th January 2023

Here's the internal code that JSE uses
[code]
a=parseFloat(JSE_arg[JSE_sID+0]); JSE_Rt=1;
b=parseFloat(JSE_arg[JSE_sID+100]);
c=parseFloat(JSE_arg[JSE_sID+200]);
if (b>c) {d=b;b=c;c=d;}
d=(c-b); a=(a-b)%d; if (a<0) {a=d+a;} a*snip*


steve_ancell

Keeping a value in a range?

15th January 2023

I would just go with what rychan said, put a cap on each end.


steve_ancell

Poll Chat

15th January 2023

Would you Rather?
Fart every time you meet someone new
Burp every time you kiss someone
-=-=-
No prizes for guessing my vote. :D


Pakz

Dall-e 2

15th January 2023

There is a lawsuit coming against certain ai like midjourney. It might even be possible that any art created by ai has to be taken down. I am only speculating. But they are going in hard.


Jayenkai

QOTD - January 2023

15th January 2023

I never got out and explored. Post-crap, I really resent not having really been anywhere. I enjoyed walking to school/college/town/work, but never bothered to venture more than that. And I should've done. I enjoyed walking, and now that I can barel*snip*


Socoder

QOTD - January 2023

15th January 2023

Question of the Day : January 15th What's your biggest regret in life?


rockford

AGameAWeek 2023

15th January 2023

That penguin looks super cute and the game looks cool ;) :D


spinal

AGameAWeek 2023

15th January 2023

A very nice game, the penguin makes a refreshing change from Platdude (no an insult). Also quite trickey to controls, which adds to the ''no instantly good at it'' factor. :-)


AndyH

AGameAWeek 2023

15th January 2023

Really nice game. Has frostbite vibes to it, but different.


cyangames

AGameAWeek 2023

15th January 2023

Yay Penguins!!!!! What cute lil animations on him :D Got up to 775 on my third try, legit gets tough!


Pakz

Keeping a value in a range?

15th January 2023

I am experimenting with some code I remember seeing in a raycasting tutorial. I think this does what it needs to. But I need to test it further.
Doing the modula with the end of the range seems to align and cycle it correctly.
[code]
// 3dsage ra*snip*


cyangames

QOTD - January 2023

15th January 2023

To get fitter


cyangames

Keeping a value in a range?

15th January 2023

In pesudocode would it look something like this?
[code]
fullRange = maximumValue - minimumValue
If yourValue > maximumValue then
while yourValue > maximumValue
yourValue -= fullRange
end while
else if yourValue < minimumValue then
whi*snip*


Pakz

Keeping a value in a range?

15th January 2023

I am having a hard time finding the right words for this situation.
I have a number. This could be any number. Positive or negative. How would I keep this in a range. This a range of array slots.
0...10
15 should become 5.
0....10
-15 should become 5.*snip*


Pakz

Very busy coding.

14th January 2023

(Image.png)
I added the first file for a new project a week ago. I have spent a lot of time coding. I even think I might have forgotten to vote on the polls one or more times. My main code crossed the c64 memory size. +64kb.
I do need to take breaks t*snip*


Jayenkai

AGameAWeek 2023

14th January 2023

GotoJSE
Chilly Charlie
Eat the fishies, Charlie! Eat them all!!!
Nom nom nom!!!
JSE Code
[spoiler]
[jse]// Chilly Charlie
// by Jayenkai
// Created 2023/1/10
// GotoJSE.com/XXm8T84J.BAS
Symbol 0,''2__0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0v_v!0_0/v_*snip*

Newer Posts More - Older Posts