10liner basic parallax scrolling

Página 2/3
1 | | 3

Por NYYRIKKI

Enlighted (6067)

Imagen del NYYRIKKI

15-02-2020, 22:48

The game and source are both very lovely. I like this!

Here is direct MSXPen-link:
https://msxpen.com/codes/-M09ofg1kqfj1kyPXDVW

Por Dolphin101546015

Champion (336)

Imagen del Dolphin101546015

16-02-2020, 05:08

thegeps wrote:

Explanation is very easy and complete (like a "for dummy") because I had to explain the code to non msx users

Standart RND in MSX Basic is very expensive function by speed Wink

Por thegeps

Paragon (1189)

Imagen del thegeps

16-02-2020, 12:41

Yep, and sqr too... but in a basic contest you have to use what your basic gives you...

Por Dolphin101546015

Champion (336)

Imagen del Dolphin101546015

16-02-2020, 12:54

Actualy - no, your code loking like code of good programmers, then you know another ways for doing it faster Wink

Por thegeps

Paragon (1189)

Imagen del thegeps

16-02-2020, 12:57

Rnd? Really not (probably it is obvious but I can't see it)

Por Dolphin101546015

Champion (336)

Imagen del Dolphin101546015

16-02-2020, 13:14

You have TIME system variable Smile

Por thegeps

Paragon (1189)

Imagen del thegeps

16-02-2020, 13:23

Yep, I know, but if I need a number in a range 2-18 I had to do too things and I have a 10line limit, 120 chars for each line, line numbers included. And if I have to divide and/or multiply then where is the speed gain?

Por Dolphin101546015

Champion (336)

Imagen del Dolphin101546015

16-02-2020, 13:57

thegeps wrote:

Yep, I know, but if I need a number in a range 2-18 I had to do too things and I have a 10line limit, 120 chars for each line, line numbers included. And if I have to divide and/or multiply then where is the speed gain?

X=((TIME and 15)+3)-((TIME and 1)=0)
It's a little longer, but several times faster
Ofc, TIME is not integer, and will give overflow.
But &hFC9E, return BYTE Wink (And FC9F - high byte)

Por thegeps

Paragon (1189)

Imagen del thegeps

16-02-2020, 13:51

32 chars (after removing unwanted spaces)... very long for a tenliner pure120. Often we have to sacrifice speed to fit code in these contests (but you got a point, it's faster. I can use it sometimes) Wink

Por Dolphin101546015

Champion (336)

Imagen del Dolphin101546015

16-02-2020, 13:56

It was a little inaccurate in the range, but you get the point Smile

Página 2/3
1 | | 3