Author Topic: jBasic  (Read 32970 times)

0 Members and 1 Guest are viewing this topic.

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6268
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: jBasic
« Reply #45 on: May 06, 2010, 07:56:37 pm »
thanks!
I just added an easter egg btw for all those who want to see it ;)
/e

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: jBasic
« Reply #46 on: May 06, 2010, 10:05:13 pm »
yeah I saw it was pretty great. People should check out

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6268
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: jBasic
« Reply #47 on: May 07, 2010, 04:28:21 pm »
I updated the demo to flow smoother, and I also added a command, collision().

collision(obj,obj2,a);
returns true if obj and obj2 are overlapping.

obj =  pointer to the first object.
obj2 = pointer to the second object.
a = area around obj2 to include.
« Last Edit: May 07, 2010, 04:48:24 pm by Eeems »
/e

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: jBasic
« Reply #48 on: May 07, 2010, 05:08:58 pm »
nice to see collision detection. However, when you have about 15-20 objects, does it measn you need to check for each objects one by one? I wonder if that would be kinda slow

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6268
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: jBasic
« Reply #49 on: May 07, 2010, 07:39:49 pm »
well, it's not working quite yet, but it's almost done.
yes, with this command it will be, but it wont be as slow as on calc, in fact 15-20 shouldn't be that bad of a slowdown.
« Last Edit: May 07, 2010, 07:41:00 pm by Eeems »
/e

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: jBasic
« Reply #50 on: May 07, 2010, 07:41:33 pm »
aaah nice ^^

so what kind of games would be possible for this btw? And we can use whatever image we want, right? Could we even use animated gifs?

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6268
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: jBasic
« Reply #51 on: May 07, 2010, 08:20:34 pm »
I'm currently working on collision() with builderboy, so it should work very soon. collision() is going to be square collision detection though, so you will have to make your own for circles.

any game would be possible, as long as you have the patience to code it, and the computer has the speed to run it.
yes you can use whatever image you want, as long as the browser supports it.

also collision() is changed to this: collision(obj,obj2,x,y)
x is for the x extension on the check, and y for the y one.

EDIT: fixed it! yay!
« Last Edit: May 07, 2010, 08:36:06 pm by Eeems »
/e

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: jBasic
« Reply #52 on: May 08, 2010, 12:10:15 am »
By any games, does this includes games with highscores/save data?

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6268
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: jBasic
« Reply #53 on: May 08, 2010, 12:20:50 am »
Yes actually, I'll have to make some routines, but making highscores shouldn't be to hard. You just save/recall from a text file, or if you want to store lots of data in one file, an xml file will do the trick. I'll have to do some looking into how to parse xml with javascript due to the fact that i've only done it with php.

Hmm, any other good ideas? I want to be able to stuff as much as I can into this :p
/e

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: jBasic
« Reply #54 on: May 08, 2010, 12:24:07 am »
Aaah ok. Wouldn't highscores be very easy to hack that way, tho? Again, the user could code some sort of encryption himself so if the user modify a highscore the wrong way, they're deleted

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6268
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: jBasic
« Reply #55 on: May 08, 2010, 12:26:31 am »
Hmm, true...well I'll have to figure a good way to encrypt it and such.

If anybody has a command idea let me know, I'm open to suggestions.
/e

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: jBasic
« Reply #56 on: May 08, 2010, 12:30:10 am »
lists and strings would be cool, and for the later, a Sub() command. Those would come handy for data storage, text convos and tilemapping.

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6268
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: jBasic
« Reply #57 on: May 08, 2010, 11:53:43 am »
Actually they already exsist in javascript. To make a string you just do: var varname = "string";  they have a few more powerful and different versions of sub as well. How you use them is varname.command(); I'll include them in the tutorial when I make it.
To make an array you can do:
Code: [Select]
1: var myCars=new Array();
myCars[0]="Saab";
myCars[1]="Volvo";
myCars[2]="BMW";

2:
var myCars=new Array("Saab","Volvo","BMW");

 3:
var myCars=["Saab","Volvo","BMW"];
and to call from an array you can do this:
Code: [Select]
myCars[#]; and do whatever you want with it. Arrays can hold any data type, even another array! This will make multidimensional arrays :)
/e

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: jBasic
« Reply #58 on: May 08, 2010, 12:21:09 pm »
Aaaah ok I see. It would be nice to have the command integrated in a TI-BASIC-like syntax in your stuff

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6268
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: jBasic
« Reply #59 on: May 08, 2010, 03:28:22 pm »
Thars true, although i feel like im reinventing the wheel, for tge arrays, its pretty much TI-Basic syntax, but I guess I'll make a command for sub()
/e