* *


Welcome, Guest. Please login or register.
Did you miss your activation email?
February 24, 2018, 02:37:33 AM

Login with username, password and session length


  • Total Posts: 12198
  • Total Topics: 1739
  • Online Today: 64
  • Online Ever: 195
  • (February 11, 2014, 01:46:08 PM)
Users Online
Users: 1
Guests: 37
Total: 52
Baidu (14)

Author Topic: OxygenBasic: New OOP BASIC like language that is also much much more  (Read 3355 times)

0 Members and 1 Guest are viewing this topic.

Offline kryton9

  • Hero Member
  • *****
  • Posts: 971
  • Bananas: 6
  • Gender: Male
Charles Pegge, has gotten his Oxygen thinBasic module out as its own stand alone language now.
You can code in object oriented or procedurally in a BASIC syntax. It understands c headers, you can write in assembly, it can assemble changes on the fly.
It does more than I can give justice to by describing it here.

Here is the download link site: http://sourceforge.net/projects/oxygenbasic/files/

Here is a description and forum for support.

Charles is currently working on making an editor for it based on opengl. This will make it one of the most interesting code editors for those into graphics.
It comes with an SciTe editor right now, that you will probably want to customize with a user properties file.

Here is one that I used as a starting point to tweak and am still tweaking:

Offline zlatkoCB

  • Sr. Member
  • ****
  • Posts: 476
  • Bananas: 2
  • Gender: Male
Re: OxygenBasic: New OOP BASIC like language that is also much much more
« Reply #1 on: January 12, 2014, 03:40:48 AM »
This example represent how is easy to
use OOP in Oxygen Basic.

Code: [Select]
include "..\GDIWindow\window.inc"
Window "Consume Grow and Multiply", 640, 480, 2
sys xscreen =640, yscreen =480, i, sz
'Font 12,24,0,"courier"
sys anzahl=300

single xmitte = xscreen/2, ymitte = yscreen/2

class UnitParticle

single x,y,xv,yv,ra
sys    sz,bou,mark
byte   red,green,blue,alpha

end class

class Particles

  sys    pob,popn
  string sbuf

method index(sys i)
  pob=strptr(sbuf)+i*sizeof UnitParticle
end method

method populate(sys e)
  sys i,b
  sbuf=nuls e*sizeof UnitParticle
  pob=strptr sbuf
  for i=0 to <e
    pob+=sizeof UnitParticle
end method

method rebirth()
  single r,a
  @this = pob
  x     = xmitte
  y     = ymitte
  a     = rand(1,628)*.01
  r     = rand(20,100)*.02
  xv    = r*cos(a)*.5
  yv    = r*sin(a)*.5
  ra    = rand(9,12)
  red   = rand(0,60)
  green = rand(100,250)
  blue  = rand(160,250)
  bou   = 0
  mark  = 0
end method

method outside() as sys
  if x<0 or y<0 or x>=xscreen or y>=yscreen then return 1
end method

method MergeContact(sys j) as sys
  sys k=strptr sbuf
  particles *p
  float c,g
  sys i,e=popn-1
  if bou=0 then return 0 'no interaction
  if mark then return 0
   for i=0 to e
   if i<>j
    @p=k+i*sizeof UnitParticle
    if p.mark=0 and p.bou=1
     c=hypot(x-p.x, y-p.y)
     if c<ra then
      g=hypot( ra, p.ra )
      if ra>=p.ra then
       p.mark=1 'off field
       ra=g     'grow
       mark=1   'off field
       p.ra=g   'grow
       exit for 'early exit
      end if
     end if
    end if
   end if
end method

method progeny(sys j)
  sys i,c,q
  sys id=@this, e=popn-1, k=strptr sbuf
  particles *p
  if bou=0 or mark=1 then return
  if ra>50 then 'size threshhold
   for i=0 to e
    if i<>j
     @p=k+i*sizeof UnitParticle
     if p.mark then
      if c >30 then exit for 'limit progeny
      p.x=x : p.y=y
      ra=10 'remaining size after giving birth
     end if
    end if
  end if
end method

method setmark(sys a)
end method

method move()
  x += xv
  y += yv
end method

method bounce()
  sys c
  if x>=xscreen
    xv=-xv : x=xscreen-1 : c=1
  elseif x<=0
    xv=-xv : x=1 : c=2
  end if
  if y>=yscreen
    yv=-yv : y=yscreen-1 : c=3
  elseif y<=0
    yv=-yv : y=1 : c=4
  end if
  if c
    bou=1 'activate
  end if
end method

method show()
  if bou=0 then
    Oval x-ra, y-ra, sz, sz, 0, red+120, 0
    Oval x-ra, y-ra, sz, sz, red, green, blue
  end if
end method

method act(sys i)
  index i
  if outside then
  end if
  progeny i
  MergeContact i
end method

end class

sys c
particles pa
pa.populate anzahl

While Key(27)=0
ClsColor 80,0,0
for i=0 to <anzahl
  pa.act i
WaitFPS 80


To link to us use this code/button on your site




Blue Steel

January 01, 2018, 04:34:54 AM
Happy new year to all

Blue Steel

December 25, 2017, 06:13:27 AM
merry christmas and seasons greetings to one and all

Blue Steel

December 09, 2017, 02:46:53 AM
:) ty fingers crossed

Larry McCaughn

December 08, 2017, 04:10:56 PM
I'll give you a Shout out in the Shout Box for being able to put it back up.


September 20, 2017, 01:57:54 PM
Hey that's my job. Didn't choose this username for nothing you know.  :)

Larry McCaughn

September 19, 2017, 12:24:13 AM
lurking in the shadows, lurkalot.


September 16, 2017, 04:39:43 PM
Good evening all.  Where is everyone?


September 12, 2017, 12:57:36 PM
Good to hear, it's nice to see a empty error log. ;)

Blue Steel

September 12, 2017, 05:04:25 AM
running sites log files overnight heres the result (I know mainly spiners) "There are currently no error log entries." :)


September 12, 2017, 03:19:33 AM
Morning all.  :)

Blue Steel

September 12, 2017, 01:12:33 AM
Let it all out ..
these are the things I can't do without  ;)


September 11, 2017, 11:14:22 PM


September 11, 2017, 08:16:02 PM
Shouting is Go !  ;D

Blue Steel

September 11, 2017, 06:54:02 PM
gradually getting there


September 11, 2017, 05:22:46 PM
Yay, you found it.  ;)

Larry McCaughn

September 11, 2017, 01:07:13 PM
looks like you're making good progress

Blue Steel

September 07, 2017, 10:34:19 PM
yay recent topics are working again in the center of the home page :)

Larry McCaughn

July 12, 2017, 05:46:33 PM
Blue Steel is back running the show.  Maybe he'll be able to build some steam in the ole place!

Blue Steel

June 26, 2017, 04:58:41 AM
hope i didn't scare too many of you

Blue Steel

June 26, 2017, 04:58:12 AM
Boo, i'm still here alive and well , see my post in introductions


July 25, 2016, 01:43:24 AM
That sounds cool. Have to chekc out IWBasic in the next days.

Larry McCaughn

July 22, 2016, 11:47:00 PM
I'm hoping to issue a new maintenance release to the IWBasic 3.x IDE in the next few weeks and Larry Sikes has released an update to the Linux version of IWBasic and is currently working on the 64bit version of IWBasic.  Progress should speed up since he has retired and has apparently resolved his m


July 19, 2016, 02:53:02 PM
Anything interesting going on around BASIC?

Larry McCaughn

July 18, 2016, 09:14:12 AM
Hello Mike