Author Topic: BASIC movement  (Read 12119 times)

0 Members and 2 Guests are viewing this topic.

Offline BlakPilar

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 734
  • Rating: +44/-1
    • View Profile
Re: BASIC movement
« Reply #30 on: February 18, 2012, 12:34:14 pm »
Did you try the matrix-based version I sent you? Or do you just want to do a string-based mapper?

Offline saintrunner

  • Custom Spriter: You ask it! I'll Make it!
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1787
  • Rating: +115/-11
  • Flogging Molly
    • View Profile
    • Jonny K Music
Re: BASIC movement
« Reply #31 on: February 18, 2012, 12:34:19 pm »
not sure, just says invalidDim
My Sprites Thread   :Updated often :) for your viewing pleasure

GAMES:

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: BASIC movement
« Reply #32 on: February 18, 2012, 12:35:02 pm »
what are your x and y values right now?
Sig wipe!

Offline chattahippie

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 358
  • Rating: +27/-0
  • Super Member! :D
    • View Profile
Re: BASIC movement
« Reply #33 on: February 18, 2012, 12:35:20 pm »
Set them both to 2

Offline BlakPilar

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 734
  • Rating: +44/-1
    • View Profile
Re: BASIC movement
« Reply #34 on: February 18, 2012, 12:36:24 pm »
which part does it throw errors?
EDIT: maybe G is 45 BEFORE the loops starts. to prevent that, add DelVarG before Repeat G.

Repeat loops always go through once no matter what, so that shouldn't be the problem.
« Last Edit: February 18, 2012, 12:36:49 pm by BlakPilar »

Offline saintrunner

  • Custom Spriter: You ask it! I'll Make it!
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1787
  • Rating: +115/-11
  • Flogging Molly
    • View Profile
    • Jonny K Music
Re: BASIC movement
« Reply #35 on: February 18, 2012, 12:36:25 pm »
they are
My Sprites Thread   :Updated often :) for your viewing pleasure

GAMES:

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: BASIC movement
« Reply #36 on: February 18, 2012, 12:36:37 pm »
Did you try the matrix-based version I sent you? Or do you just want to do a string-based mapper?
Matrix tilemapping will be definitely faster. However, the size when the map gets kinda big....
* TBO_Yeong shudders


which part does it throw errors?
EDIT: maybe G is 45 BEFORE the loops starts. to prevent that, add DelVarG before Repeat G.
Repeat loops always go through once no matter what, so that shouldn't be the problem.
Crap. I totally forgot about that. D:

EDIT: Optimization and fix :D
chattahippie got his sub( argument mixed up XD
Code: [Select]
"
0ANYTHING000000  //Take out the newlines, of course, so the interpreter doesn't freak out
0             0
0             0
0     :)      0
00WORKS!!!1!100 ->Str1  //You can make the map bigger for more space to move

ClrHome
2->X
2->Y
Output(1,1,Str1
Repeat G=45
Repeat G
getkey->G
End
Output(X,Y,"
Y-(G=24 and sub(Str1,16X-17+Y,1) = "_")+(G=26 and sub(Str1,16X-15+Y,1) = "_->Y
X-(G=25 and sub(Str1,16X-32+Y,1) ="_")+(G=34 and sub(Str1,16X+Y+1,1) = "_->X
Output(X,Y,"@
End
ClrHome
Stop
« Last Edit: February 18, 2012, 12:42:42 pm by TBO_Yeong »
Sig wipe!

Offline chattahippie

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 358
  • Rating: +27/-0
  • Super Member! :D
    • View Profile
Re: BASIC movement
« Reply #37 on: February 18, 2012, 12:43:34 pm »
chattahippie got his sub( argument mixed up XD

I just noticed as well D:
getting rusty on my TIBASIC
« Last Edit: February 18, 2012, 12:43:54 pm by chattahippie »

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: BASIC movement
« Reply #38 on: February 18, 2012, 12:45:41 pm »
getting rusty on my TIBASIC

That's why I practice TI-BASIC XD
* TBO_Yeong is rusty on his Axe. D:
Sig wipe!

Offline chattahippie

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 358
  • Rating: +27/-0
  • Super Member! :D
    • View Profile
Re: BASIC movement
« Reply #39 on: February 18, 2012, 12:48:13 pm »
getting rusty on my TIBASIC

That's why I practice TI-BASIC XD
* TBO_Yeong is rusty on his Axe. D:

[dramatic music backing]lol, the thing is, I still practice TI-BASIC too! D:[/dramatic music backing]

I'm making a (simple) snake game as well as my axe game
but the thing is, Im not using sub( yet :P

Offline saintrunner

  • Custom Spriter: You ask it! I'll Make it!
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1787
  • Rating: +115/-11
  • Flogging Molly
    • View Profile
    • Jonny K Music
Re: BASIC movement
« Reply #40 on: February 18, 2012, 01:21:11 pm »
IT WORKS! Thanks so much! any way to make it so it tests certain 'tiles' ?


edit: bug....if you have a tile too your right you can't move down!
« Last Edit: February 18, 2012, 01:40:59 pm by saintrunner »
My Sprites Thread   :Updated often :) for your viewing pleasure

GAMES:

Offline chattahippie

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 358
  • Rating: +27/-0
  • Super Member! :D
    • View Profile
Re: BASIC movement
« Reply #41 on: February 18, 2012, 01:41:02 pm »
IT WORKS! Thanks so much! any way to make it so it tests certain 'tiles' ?

Just check sub(Str1,(X-1)16+Y,1)
It will return the character you are standing on
and from there, you can have them do different things

But note, the code provided to check for collision will not allow you to stand on anything other than spaces, so you will have to adjust for that

Offline saintrunner

  • Custom Spriter: You ask it! I'll Make it!
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1787
  • Rating: +115/-11
  • Flogging Molly
    • View Profile
    • Jonny K Music
Re: BASIC movement
« Reply #42 on: February 18, 2012, 01:42:12 pm »
theres a bug, if you have a tile to your right you can't move down, also do I change the current subs with the above or do I just add it before?
« Last Edit: February 18, 2012, 01:44:38 pm by saintrunner »
My Sprites Thread   :Updated often :) for your viewing pleasure

GAMES:

Offline chattahippie

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 358
  • Rating: +27/-0
  • Super Member! :D
    • View Profile
Re: BASIC movement
« Reply #43 on: February 18, 2012, 02:04:54 pm »
My code (and Yeong's "fixed" code :P ) had a small bug, this should work better:
Code: [Select]
"
0ANYTHING000000  //Take out the newlines, of course, so the interpreter doesn't freak out
0             0
0             0
0     :)      0
00WORKS!!!1!100 ->Str1  //You can make the map bigger for more space to move

ClrHome
2->X
2->Y
Output(1,1,Str1
Repeat G=45
Repeat G
getkey->G
End
Output(X,Y,"
Y-(G=24 and sub(Str1,16X-17+Y,1) = "_")+(G=26 and sub(Str1,16X-15+Y,1) = "_->Y
X-(G=25 and sub(Str1,16X-32+Y,1) ="_")+(G=34 and sub(Str1,16X+Y,1) = "_->X
Output(X,Y,"@

"example for event
If sub(Str1,16X-32+Y,1)="E
Then
"Event stuff here"
End

End
ClrHome
Stop
There was a +1 in the wrong place :P

For the example I put in there, it will check the tile above to see if it is an "E"
I wouldn't use this way for too many events though, it will cause a speed loss for each event you add

Offline saintrunner

  • Custom Spriter: You ask it! I'll Make it!
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1787
  • Rating: +115/-11
  • Flogging Molly
    • View Profile
    • Jonny K Music
Re: BASIC movement
« Reply #44 on: February 18, 2012, 02:17:33 pm »
Thanks so much :) you all have helped so much
My Sprites Thread   :Updated often :) for your viewing pleasure

GAMES: