Keypress keywords

Description: Have any suggestions or new ideas for SMBX-38A? This is a place for you. Good suggestions may appear in future versions of SMBX-38A.
Moderators: Yoshi021, Lx Xzit, 5438A38A, Semi-moderatos, Moderators

Lx Xzit M
Topic author, Moderator
Moderator
Avatar
Lx Xzit M
Topic author, Moderator
Moderator
Reputation: 256
Posts: 588
Joined: 9 Nov 2015
Website

Post #1by Lx Xzit » 5 Aug 2019, 0:49

When I work with "keypress" function, I always have to open the table of the inputs since it's hard to associate the numbers with what they represent.
My suggestion is adding a bit of more flexibility to the syntaxis allowing keywords that would be interpreted in the same way, so that:

Code: Select all

if keypress(-11) then


would be equal to:

Code: Select all

if keypress(RIGHT) then


The same with the other keys that are in this table:
Spoiler
Image

For the second player, I thought on adding a "_2" at the end to differentiate:

Code: Select all

if keypress(-21) then

Code: Select all

if keypress(RIGHT_2) then


or just leaving it the same, since you could also do this:

Code: Select all

if keypress(RIGHT)-10 then
VISIT MY YOUTUBE CHANNEL! LX XZIT
Join our 38A Discord server!

Image

NESTED ERNEST M
Duke
Duke
Avatar
NESTED ERNEST M
Duke
Duke
Reputation: 7
Posts: 112
Joined: 23 Sep 2017
Location: Perú, Lima
Website

Post #2by NESTED ERNEST » 9 Aug 2019, 0:21

And because better instead of putting:
  "right" put "r1"
  "left" put "l1"
  "up" put "u1"
  "down" put "d1"
(for player1)

And for player2 "r2", "l2", "u2", "d2"

This is shorter.
Programming NPCs in SMBX-38A is fun:

ROCKMAN GIF IN SMBX 38A

Image

Lx Xzit M
Topic author, Moderator
Moderator
Avatar
Lx Xzit M
Topic author, Moderator
Moderator
Reputation: 256
Posts: 588
Joined: 9 Nov 2015
Website

Post #3by Lx Xzit » 9 Aug 2019, 5:41

It doesn't need to be shorter, it has to be clearer and easier to understand. I really recomend you reading naming convention suggestions since I don't think none of your suggestions actually meets them.

What happens with "right" &"run" and "Alt run" & "Alt jump"? We just would reserve "r" and "alt" in some cases but not in others? Also why it does have to have the number 1 at the end, when you rarely will work with second player keys?
VISIT MY YOUTUBE CHANNEL! LX XZIT
Join our 38A Discord server!

Image

NESTED ERNEST M
Duke
Duke
Avatar
NESTED ERNEST M
Duke
Duke
Reputation: 7
Posts: 112
Joined: 23 Sep 2017
Location: Perú, Lima
Website

Post #4by NESTED ERNEST » 9 Aug 2019, 6:51

It is true that it could be called "r", "l", "u", "d"

I only meant the arrow keys.

Nothing would happen: there would be no problem that "run" is called "run".

and why put an underscore and not just right2?
Programming NPCs in SMBX-38A is fun:

ROCKMAN GIF IN SMBX 38A

Image


Return to “Ideas & Suggestions”

Who is online (over the past 5 minutes)

Users browsing this forum: 1 guest