[SOLVED] How to check if the player is going a certain direction?

Description: Internal scripting system of SMBX-38A Engine based on the simple VB-like language
Moderators: Lx Xzit, Yoshi021, 5438A38A, Semi-moderatos, Moderators

9th_core
Topic author, Honourable citizen
Honourable citizen
9th_core
Topic author, Honourable citizen
Honourable citizen
Reputation: 0
Posts: 36
Joined: 17 Aug 2016

Post #1by 9th_core » 15 Dec 2016, 14:44

The title says it all. How to check if the player is going left or right? Thanks! :)

Yave Yu M
Count
Count
Avatar
Yave Yu M
Count
Count
Age: 27
Reputation: 50
Posts: 242
Joined: 25 Jan 2016

Post #2by Yave Yu » 15 Dec 2016, 19:24

Char(1).Xsp
If >0, going right
ElseIf <0, going left

or use Chat(1).Facing

NESTED ERNEST M
Count
Count
Avatar
NESTED ERNEST M
Count
Count
Reputation: 71
Posts: 268
Joined: 23 Sep 2017
Location: Perú, Lima
Youtube channel URL

Post #3by NESTED ERNEST » 23 Sep 2017, 5:44

Do

If char(1).xsp>0 then
'the player is going right
elseif char(1).xsp<0 then
'the player is going left
end if

loop
Programming NPCs in SMBX-38A is fun:
That is me
Image
Image
Image
Image

Special image
  • yt-image-banner: https://yt3.ggpht.com/M_O1AzQEOJogSq5OJESIaA5kFLdbwdDNMihDOJkJgPiH7cOx-LWK41TU9GWzExmkmpn3EWYbJg=w1060-fcrop64=1,00005a57ffffa5a8-k-c0xffffffff-no-nd-rj
  • image-to-up: https://3.bp.blogspot.com/-Y-LrpIS2rqw/UCBTtk7k-pI/AAAAAAAABBs/qZuI0sCStkc/s1600/jean-baptiste+beaudelle+girafe++escargot.jpg
  • image-to-left: https://us.123rf.com/450wm/trassnick/trassnick2007/trassnick200700002/152919781-el-marl%C3%ADn-negro-grande-salta-del-mar-pesca-extrema-del-pez-espada-negro-en-alta-mar-vacaciones-en-lo.jpg
  • image-last-w: 1


ROCKMAN GIF IN SMBX 38A

Image

9th_core
Topic author, Honourable citizen
Honourable citizen
9th_core
Topic author, Honourable citizen
Honourable citizen
Reputation: 0
Posts: 36
Joined: 17 Aug 2016

Post #4by 9th_core » 23 Sep 2017, 16:11

Rutherford wrote:Do

If char(1).xsp>0 then
'the player is going right
elseif char(1).xsp<0 then
'the player is going left
end if

loop
This post was dead so no need to reply to it lol

NESTED ERNEST M
Count
Count
Avatar
NESTED ERNEST M
Count
Count
Reputation: 71
Posts: 268
Joined: 23 Sep 2017
Location: Perú, Lima
Youtube channel URL

Post #5by NESTED ERNEST » 23 Sep 2017, 18:02

You forgot to put [solved]
Programming NPCs in SMBX-38A is fun:
That is me
Image
Image
Image
Image

Special image
  • yt-image-banner: https://yt3.ggpht.com/M_O1AzQEOJogSq5OJESIaA5kFLdbwdDNMihDOJkJgPiH7cOx-LWK41TU9GWzExmkmpn3EWYbJg=w1060-fcrop64=1,00005a57ffffa5a8-k-c0xffffffff-no-nd-rj
  • image-to-up: https://3.bp.blogspot.com/-Y-LrpIS2rqw/UCBTtk7k-pI/AAAAAAAABBs/qZuI0sCStkc/s1600/jean-baptiste+beaudelle+girafe++escargot.jpg
  • image-to-left: https://us.123rf.com/450wm/trassnick/trassnick2007/trassnick200700002/152919781-el-marl%C3%ADn-negro-grande-salta-del-mar-pesca-extrema-del-pez-espada-negro-en-alta-mar-vacaciones-en-lo.jpg
  • image-last-w: 1


ROCKMAN GIF IN SMBX 38A

Image


Return to “TeaScript”

Who is online (over the past 5 minutes)

Users browsing this forum: 1 guest