Author Topic: new Event based OOPL idea  (Read 3888 times)

0 Members and 1 Guest are viewing this topic.

Offline Spyro543

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1189
  • Rating: +74/-3
    • View Profile
new Event based OOPL idea
« on: August 15, 2011, 06:35:32 pm »
Recently I got an idea for a new programming language I call Project Vortex (not quite sure why).
It'll be event based and object oriented programming. I got most of my inspiration from Game Maker. And just like Game Maker, this language will be made mainly for games.

Here are the events I've thought of so far:
onStart: Happens when the program is started.
onExit: Happen when the program is closed.
onCreate: Happens when the object is initialized.
onKeyPress: Here is a list of all the keys you can put in onKeyPress:
Spoiler For Spoiler:
onKeyPress(<key>)
Q W E R T Y U I O P A S D F G H J K L Z X C V B N M
[ ] ; ' , . / \ 12345567890 ` - =
Tab Space Enter Ctrl Alt Delete Bksp Up Down Left Right
onKeyRelease: Same as onKeyPress but happens when a key is released.
onCollision: Happens when the object's sprite overlaps the specified object.
onEnd: Happens when an object is destroyed (ended).
This is all I can think of right now :P

Object Oriented Programming Syntax
Object(): Creates a new object.
Inside of the (): Object(<name>,<variables>)
Spoiler For creating an object:
Before we do anything, we have to make the "playing field"

~This is a comment
Area("area",600,600)   ~Creates a new area by the name area and makes it 600 by 600 px
area.bg(0xFFFFFF)   ~Sets the background of the area to black

~Now we make the object
Object("HelloWorld") {
     onCreate {   ~The code inside of the {} gets executed when this object is called
          var say = "Hello World!"   ~Creates var say and puts "Hello World" in it
          say = inputbox "What do you want to say?"    ~Shows a text box and stores the input in say
          labelbox say  ~Shows a window that contains the text of say
     }
}

area.show()   ~Displays the area on the screen
HelloWorld.sprite("")   ~Sets the sprite of the HelloWorld object. Empty quotes make it invisible
HelloWorld.disp("area",1,1)   ~Displays the object on the area at location 1,1

This program takes input from the user and shows it.

This is a horridly incomplete concept. Help and suggestions would be nice. Thanks in advance :)

Offline Scipi

  • Omni Kitten Meow~ =^ω^=
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1547
  • Rating: +192/-3
  • Meow :3
    • View Profile
    • ScipiSoftware
Re: new Event based OOPL idea
« Reply #1 on: August 15, 2011, 06:42:56 pm »
Sounds to me it could be more of a library for an existing language. Or will these Objects already have all these child functions built in?

Imma Cat! =^_^= :3 (It's an emoticon now!)
Spoiler For Things I find interesting:
Spoiler For AI Programming:
Spoiler For Shameless advertising:

Spoiler For OldSig:





Spoiler For IMPORTANT NEWS!:
Late last night, Quebec was invaded by a group calling themselves, "Omnimaga". Not much is known about these mysterious people except that they all carried calculators of some kind and they all seemed to converge on one house in particular. Experts estimate that the combined power of their fabled calculators is greater than all the worlds super computers put together. The group seems to be holding out in the home of a certain DJ_O, who the Omnimagians claim to be their founder. Such power has put the world at a standstill with everyone waiting to see what the Omnimagians will do...

Wait... This just in, the Omnimagians have sent the UN a list of demands that must be met or else the world will be "submitted to the wrath of Netham45's Lobster Army". Such demands include >9001 crates of peanuts, sacrificial blue lobsters, and a wide assortment of cherry flavored items. With such computing power stored in the hands of such people, we can only hope these demands are met.

In the wake of these events, we can only ask, Why? Why do these people make these demands, what caused them to gather, and what are their future plans...

Offline Spyro543

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1189
  • Rating: +74/-3
    • View Profile
Re: new Event based OOPL idea
« Reply #2 on: August 15, 2011, 06:46:11 pm »
Well...I have no idea.

Offline BlakPilar

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 734
  • Rating: +44/-1
    • View Profile
Re: new Event based OOPL idea
« Reply #3 on: August 15, 2011, 07:41:18 pm »
Do I smell a possible collaboration? :O

EDIT: I meant for the envrionment.
« Last Edit: August 15, 2011, 10:47:11 pm by BlakPilar »

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: new Event based OOPL idea
« Reply #4 on: August 15, 2011, 08:14:36 pm »
If you're going to do graphics stuff, I'd recommend either staying away from pixels as the unit of measurement or allowing programs to get the screen size to do their own scaling.
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Ashbad

  • Guest
Re: new Event based OOPL idea
« Reply #5 on: August 15, 2011, 08:33:39 pm »
Well, a few ideas:

That Object() idea is a decently interesting spin on the creation of an object, but the name (like Area("area"); ) should probably be something like Area(area) (no quotes around the name, since it makes an impression that the handle for the object is based on a string identifier)

The events thing sounds more like a library sort of thing than a language feature; I suggest just letting developers have access to low level stuff to set the requirements for event queueing, and maybe build upon that basic feature by putting those types of pre-made events in a standard language library (like "stdevt.h" or the language's equivalent)

Also for method declarations, instead of putting something like "onCreate { ... }" put something more like "method onCreate { ... }" so people know it's a method (and if this is a statically typed language, make it something like "<type> method onCreate { ...}" or "method onCreate (<args>) returns <type> { ... }" or something of the like)

« Last Edit: August 15, 2011, 08:34:04 pm by Ashbad »

Offline Binder News

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 785
  • Rating: +46/-3
  • Zombie of Tomorrow
    • View Profile
Re: new Event based OOPL idea
« Reply #6 on: August 15, 2011, 10:02:39 pm »
what about:
method void onCreate(<args>)
{
...
}

Also, I have a good way to implement instance ids. I'll post it later.
« Last Edit: August 15, 2011, 10:04:35 pm by Binder News »
Spoiler For userbars:







Hacker-in-training!   Z80 Assembly Programmer     Axe Programmer
C++ H4X0R             Java Coder                           I <3 Python!

Perdidisti ludum     Cerebrum non habes

"We are humans first, no matter what."
"Fame is a vapor, popularity an accident, and riches take wings. Only one thing endures, and that is character."
Spoiler For Test Results:





Offline Spyro543

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1189
  • Rating: +74/-3
    • View Profile
Re: new Event based OOPL idea
« Reply #7 on: August 16, 2011, 08:59:11 am »
I'll have to make some changes to my first post. :P

Offline Binder News

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 785
  • Rating: +46/-3
  • Zombie of Tomorrow
    • View Profile
Re: new Event based OOPL idea
« Reply #8 on: August 17, 2011, 11:36:59 am »
Okay, for something like this you really need an object manager. Said manager will control all of the objects and object pools, will dispatch events, and so on. It will also maintain a map of all instance ids to their respective objects.
Spoiler For userbars:







Hacker-in-training!   Z80 Assembly Programmer     Axe Programmer
C++ H4X0R             Java Coder                           I <3 Python!

Perdidisti ludum     Cerebrum non habes

"We are humans first, no matter what."
"Fame is a vapor, popularity an accident, and riches take wings. Only one thing endures, and that is character."
Spoiler For Test Results: