Author Topic: Compiler Issues  (Read 3385 times)

0 Members and 1 Guest are viewing this topic.

Offline Nick Sonneveld

Re:Compiler Issues
« Reply #15 on: August 17, 2002, 12:44:28 AM »
this is true.. but who am I designing it for?  the handful of people now who have their old code?  or newbies who haven't seen agi logic before?

I want to design for both..   backwards compatibility isn't as big an issue as I thought it would be though.

- Nick
Nick Sonneveld  |  AGI Dev  |  NAGI

Offline Brian Provinciano

Re:Compiler Issues
« Reply #16 on: August 17, 2002, 01:01:27 AM »
True, but if you are going to make it a completely new concept rather than an extended version, you might want it to be on it's own/not backwards compatible.

Removing the compatibility, you could create whole new source file formats, with function blocks and such. You could make it structured, so it doesn't just start at the top, it starts at a "room100:init() {}" block or something.

I think a great thing for it would be to have something like:

---

room:init()
{
 /* which would actually be treated as "room.pic.load()"
  * or "this.pic.load()", but since it's in the room block,
  * it's not needed */
 pic.load();
 pic.draw();
 pic.discard();

 set.horizon(37);

 statusline.off();

 input.prevent();

 setControl(PROGRAM);
 
 pic.show();

 screen.display(10,1,"         Intro/Opening screen");
}

room:doit()
{
 if(have.key() || ctlJOYSTICK) {
   menu.enable();
   
   screen.lines.clear(22, 24);
   
   ego.motion.stop();
   DISABLE_GAME_FUNCTIONS = FALSE;

   room.changeTo(aNameOfAnotherRoom); // ie. "room002" or "kitchen"
}

// onExit()
room.exit()
{
  screen.print("BYE!")
}

Well, those are my ideas :) dO with them what you wish!

Offline Nick Sonneveld

Re:Compiler Issues
« Reply #17 on: August 17, 2002, 01:10:37 AM »
actually.. I suggested something along those lines in the other thread on high level compilers..

- Nick
Nick Sonneveld  |  AGI Dev  |  NAGI

Offline Nick Sonneveld

Re:Compiler Issues
« Reply #18 on: August 22, 2002, 10:21:50 AM »
Currently all the commands don't return anything except through affecting variables.  So I was thinking that perhaps you could rearrange it a bit and make one of them a "return variable"

umm.. I'll try and explain...

normally random works like this:
random(10, 100, v10);
where v10 is the variable where the random number is.

It would be cool if you could do something like this:
position(o5, random(0, 160), random(0, 200));

which would expand to:
random(0, 160, tempvar1);
random(0, 200, tempvar2);
position.v(o5, tempvar1, tempvar2);

This actually uses two ideas..  overloading random so you can return.  and overloading position so it uses position.v if you use variables..

- Nick
Nick Sonneveld  |  AGI Dev  |  NAGI


SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.035 seconds with 21 queries.