10liner basic parallax scrolling

Pagina 2/3
1 | | 3

Van NYYRIKKI

Enlighted (6033)

afbeelding van 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

Van Dolphin101546015

Champion (335)

afbeelding van 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

Van thegeps

Paragon (1175)

afbeelding van thegeps

16-02-2020, 12:41

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

Van Dolphin101546015

Champion (335)

afbeelding van 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

Van thegeps

Paragon (1175)

afbeelding van thegeps

16-02-2020, 12:57

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

Van Dolphin101546015

Champion (335)

afbeelding van Dolphin101546015

16-02-2020, 13:14

You have TIME system variable Smile

Van thegeps

Paragon (1175)

afbeelding van 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?

Van Dolphin101546015

Champion (335)

afbeelding van 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)

Van thegeps

Paragon (1175)

afbeelding van 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

Van Dolphin101546015

Champion (335)

afbeelding van Dolphin101546015

16-02-2020, 13:56

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

Pagina 2/3
1 | | 3