Join us on Discord!
You can help CodeWalrus stay online by donating here.

Advice for BASIC

Started by xMarminq_, November 17, 2016, 03:55:55 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

p2

I only did 2ND+INS --> 2ND+ENTRY...
using it directly would have been worse than pressing clear D:
  • Calculators owned: ti-83+, ti-84+, ti-84+, ti-84+se, ti-84+se(te), ti-nsphire, ti-nsphire CAS, ti-nsphire CX-CAS, ti-voyage, ti-voyage, Who reads this list anyways...?
Anyway war sucks. Just bring us your food instead of missiles  :P ~ DJ Omnimaga (11.10.2016 20:21:48)
if you cant get a jframe set up, draw stuff to it, and receive input, i can only imagine how horrible your game code is _._   ~ c4ooo (14.11.2016 22:44:07)
If they pull a Harambe on me tell my family I love them ~ u/Pwntear37d (AssangeWatch /r/)
make Walrii great again ~ DJ Omnimaga (28.11.2016 23:01:31)
God invented the pc, satan the smartphone I guess ~ p4nix (16.02.2017 22:51:49)

xMarminq_

#16
How about movable characters? (Like a one character sprite)
And boundaries for them?
  • Calculators owned: Ti-84 Plus CE, Ti-84 Plus (can be borrowed from my school)
I don't associate with associations

Unicorn

depends if you are using output or whatever,  but two varyables for X cord and H coord. You then use getkey and whenever an arrow key is pressed you increment or decrease the X or Y coord, depending on the key. at that point you have to check to make sure tht the char doesnt move out of the domain with if sgtatements. For example:


Repeat K=45
getkey->K
If K=uparrow and Y != 1
Y-1->Y
//add another if statement for moving down, increasing the Y, but not when it equals 10.
If K=rightarrow and X != 26
X+1->X
//add  another if statement for left arrows decreasing the x value, but not that it equals less than one.
Output(Y,X,"*
End


This code shoud work, even though it is untested, and be sure to remove the comments ;) You may also want to erasw things, amd this is very simple.
  • Calculators owned: I own all of them: PICKACHUP TI 84+ CSE TI 83+ SE TI something something ??? ??? ??? ??? ???
  • Consoles, mobile devices and vintage computers owned: PICKACHUP ??? ??? ??? ??? ???



??? ??? ??? ??? ???

xMarminq_

So highscore systems would be saving the score values to strings and do a ton of if string < or > or = and then move them down?
How about making the arrow direction constant?
I always feel I have the concepts, but I always need your guys help in making them in action.
  • Calculators owned: Ti-84 Plus CE, Ti-84 Plus (can be borrowed from my school)
I don't associate with associations

Dream of Omnimaga

For highscores, have you considered storing them in a list? Ideally with a custom name, such as LHELLO .
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

xMarminq_

Quote from: xMarminq_ on November 26, 2016, 11:53:17 AM
How about making the arrow direction constant?

Pls someone tell me!

Would it be a get key and then repeat until another button is pressed?
  • Calculators owned: Ti-84 Plus CE, Ti-84 Plus (can be borrowed from my school)
I don't associate with associations

Dream of Omnimaga

Do you mean how when you start holding down the arrow, the character moves once, then stops moving for half a second, then suddenly starts moving rapidly non-stop until you release the key? Because it's impossible to remove the key delay in TI-BASIC. You would need to use C or ASM.
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

xMarminq_

Just one button sends it in a constant direction
  • Calculators owned: Ti-84 Plus CE, Ti-84 Plus (can be borrowed from my school)
I don't associate with associations

Dream of Omnimaga

In such case, you need to use an extra variable. That variable is zero upon game start. If you press Left, then the variable is set to -1, if you press right, then it's set to 1. You could make it so that if you press the opposite direction than the one you're moving in or press a different key then it sets it to zero. Then when the character needs to be moved around then you add the variable value to the character position.
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

Unicorn

So, for example:


ClrHome
DelVar A
Repeat K=45
getkey->K
If K=leftarrowkey
-1->A
If K=rightarrowkey
1->A
If K=2nd
DelVar A
If A=1 and X<26
X+1->X
If A=-1 and X>1
X-1->X
Output(1,X"*
End

Just add the keycodes and erasing the text ;)
  • Calculators owned: I own all of them: PICKACHUP TI 84+ CSE TI 83+ SE TI something something ??? ??? ??? ??? ???
  • Consoles, mobile devices and vintage computers owned: PICKACHUP ??? ??? ??? ??? ???



??? ??? ??? ??? ???

xMarminq_

  • Calculators owned: Ti-84 Plus CE, Ti-84 Plus (can be borrowed from my school)
I don't associate with associations

Unicorn

Quote from: xMarminq_ on November 29, 2016, 04:19:48 AM
How about up and down?
Same thing, just change the Y instead of X and make the bounds 10 instead of 26.
  • Calculators owned: I own all of them: PICKACHUP TI 84+ CSE TI 83+ SE TI something something ??? ??? ??? ??? ???
  • Consoles, mobile devices and vintage computers owned: PICKACHUP ??? ??? ??? ??? ???



??? ??? ??? ??? ???

xMarminq_

How about walls the sprite cannot pass?
  • Calculators owned: Ti-84 Plus CE, Ti-84 Plus (can be borrowed from my school)
I don't associate with associations

WholeWheatBagels

You could have a matrix that has the map in it.

(see here http://tibasicdev.wikidot.com/maps)
Living in another world to you.



Also in case you were wondering Frankie did go to Hollywood

xMarminq_

Quote from: Unicorn on November 29, 2016, 04:10:09 AM
So, for example:


ClrHome
DelVar A
Repeat K=45
getkey->K
If K=leftarrowkey
-1->A
If K=rightarrowkey
1->A
If K=2nd
DelVar A
If A=1 and X<26
X+1->X
If A=-1 and X>1
X-1->X
Output(1,X"*
End

Just add the keycodes and erasing the text ;)

Do I need a new variable for up/down?
  • Calculators owned: Ti-84 Plus CE, Ti-84 Plus (can be borrowed from my school)
I don't associate with associations

Powered by EzPortal