Ultimate Amiga

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Please how do I make multiple libraries and inherit them into the main project?  (Read 4474 times)

0 Members and 4 Guests are viewing this topic.

xboxisfinished

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 205
  • Generic Amiga User
    • gamemakermagazine.com

   Hey guys,

I am intending to make pacman and pacman construction set. The pacman construction set is easy to do and I should have it within a month or two..a full functioning pacman construction set.

The pacman engine is the more...challenging part (I can do it though). Because of the compiler bug for AMOS....I need to be able to use unlimited amount of if statements if it should come a time where my logic requires multiple if statements (not that I want to go trillion if statements either). I was thinking...what if I wrote multiple libraries and then inside those libraries are functions or subroutines that can be called into the main program?

How do I inherit libraries and how do I make my own custom library and finally...how do I add them all into the compiler so that compiler can compiler each file separately than the other?

Thanks in advance. If this can be done..then I can make 80% of my custom chipset games on AMOS that way!
Logged

SamuraiCrow

  • compile-time wierdo
  • Forum Mod
  • A1200
  • *****
  • Karma: 5
  • Offline Offline
  • Gender: Male
  • Posts: 946
  • Compile-time wierdo

Look for the Include command.  It should be able to import external source.
Logged

Hungry Horace

  • Amorphous Blue-Blob Man
  • Site Admin
  • A4000T
  • ******
  • Karma: 307
  • Offline Offline
  • Gender: Male
  • Posts: 3,364
  • Don't forget... Ameboid's need love too!
    • AUW

" need to be able to use unlimited amount of if statements if it should come a time where my logic requires multiple if statements "

This compiler bug is very easly worked around.

The bug is only on numbers of 'ELSE IF' statments, so you have two options:

1)  Use normal IF / ENDIF that only passed on the criteria you want - dont allow ELSE to 'catch' anything you dont want it to.

2) Do your logic checking for this in a GO SUB routine. As above, use IF / ENDIF for the logic test, and then add RETURN inside the passed routine.

e.g.

Code: [Select]
GOSUB DoChecks:
.. normal code here...
END


DoChecks:

IF INPUT=UP AND NORTH_WALL=FALSE : Y=Y-1 : RETURN : ENDIF
IF INPUT=UP AND NORTH_WALL=TRUE : Y=Y : RETURN : ENDIF
IF INPUT=DOWN AND SOUTH_WALL=FALSE : Y=Y-1 : RETURN : ENDIF
IF INPUT=DOWN AND SOUTH_WALL=TRUE : Y=Y : RETURN : ENDIF

RETURN
Logged
Quote from: KillerGorilla
because winuae is made of code and your amiga is made of stuff

xboxisfinished

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 205
  • Generic Amiga User
    • gamemakermagazine.com

" need to be able to use unlimited amount of if statements if it should come a time where my logic requires multiple if statements "

This compiler bug is very easly worked around.

The bug is only on numbers of 'ELSE IF' statments, so you have two options:

1)  Use normal IF / ENDIF that only passed on the criteria you want - dont allow ELSE to 'catch' anything you dont want it to.

2) Do your logic checking for this in a GO SUB routine. As above, use IF / ENDIF for the logic test, and then add RETURN inside the passed routine.

e.g.

Code: [Select]
GOSUB DoChecks:
.. normal code here...
END


DoChecks:

IF INPUT=UP AND NORTH_WALL=FALSE : Y=Y-1 : RETURN : ENDIF
IF INPUT=UP AND NORTH_WALL=TRUE : Y=Y : RETURN : ENDIF
IF INPUT=DOWN AND SOUTH_WALL=FALSE : Y=Y-1 : RETURN : ENDIF
IF INPUT=DOWN AND SOUTH_WALL=TRUE : Y=Y : RETURN : ENDIF

RETURN

YOU ARE SERIOUS? ALL I HAVE TO DO IS MAKE SURE NOT TO USE ELSE IF??! AAAAAAAAAAAAAAAAAAAAAAAAH!!!

I AM MAKING AN ANNOUNCEMENT THAT 100% OF MY CUSTOM CHIPSET GAME PROJECTS WILL BE AMOS EXCLUSIVE! I CAN FINALLY MAKE MY DREAM GENRA OF ADVENTURE/RPG ETC ON MY AMIGA!! With the power of AMAL, build in sprite editor, etc...I HAVE LITERALLY GAME MAKER CONSTRUCTION UNDER MY HANDS AHAHAHAHAHAHAHHAAHHAHAHAHAHAHAHAH!!!!

If the compiler can compile all my projects and the one bug is else if...WHO NEEDS ELSE IF! ELSE IF IS STUPID ANYWAYS! AHAHAHAHAHAHAHA!!!

HECK...I wouldn't even bother fix the bug then..FOCUS ON THE INTERPRETER...ADD FEATURES AND FIX BUGS ON THE INTERPRETER...I wouldn't mind using compiler version 2.0 at year 2030 or 2060 (if I am still alive)!
Logged

Hungry Horace

  • Amorphous Blue-Blob Man
  • Site Admin
  • A4000T
  • ******
  • Karma: 307
  • Offline Offline
  • Gender: Male
  • Posts: 3,364
  • Don't forget... Ameboid's need love too!
    • AUW

yep, i remember having this bug myself on the Bloodwych Editor.... removal of the ELSE IFs solved it completely.

There are, of course, other bugs with the compiler, but i am sure we can help you past them!
Logged
Quote from: KillerGorilla
because winuae is made of code and your amiga is made of stuff

Pages: [1]   Go Up
 

TinyPortal 2.2.2 © 2005-2022