Page 1 of 3 123 LastLast
Results 1 to 10 of 21

Thread: TBEM - Event manager module V1.10

  1. #1

    TBEM - Event manager module V1.10

    Hi folks,

    I think I have the syntax settled and it is ready to be published. TBEM - Event manager module for thinBasic. It will help you set up events for a game. Well, it could be used for other uses too, but I was thinking more game related, when I was developing it. Included with the module is a little help file that describes the syntax right now. I will wirte some samples tonight to relieve the power of this little module. I'm pretty excited about it as I think it is really a helper when you develop games. Ok, enough bragging. Like I said, samples will follow soon, but the ones who want to play with it allready, download it now.

    Update October 18th, 2008: Version 1.10 uploaded. Bugfixes plus new zone commands

    Here is just a little console sample:

    [code=thinbasic]

    uses "TBEM"
    uses "Console"

    dim event1, event2 as long
    dim y,q,z as long
    dim stime,dtime,etime as dword
    q = 0
    z = 0
    y = 0

    %evg_system = 1
    %evg_user = 2

    %evt_game = 1
    %evt_gui = 2
    %evt_next = 3

    function FinishIt()
    console_writeline(y+") Finish")
    q = 99
    function = 0
    end function

    function getTime()
    y += 1
    console_writeline(y + ") TimeDiff="+dtime)
    function = 0
    end function

    event1 = TBEM_AddEvent("getTime",%evt_gui,getTickcount,%evg_system,%TRUE)
    event2 = TBEM_AddEvent("FinishIt",%evt_game,getTickcount+300,%evg_system,%TRUE)


    stime = gettickcount
    while q = 0
    etime = gettickcount
    dtime = etime - stime
    TBEM_AddTrigger ( %evt_gui)
    TBEM_AddTrigger ( %evt_game)
    TBEM_run(%evg_system)
    wend

    console_writeline("TriggerCount="+TBEM_GetTriggerCount+" EventCount="+TBEM_GetEventCount)

    console_writeline("Press any key...")
    Console_waitkey

    [/code]

    Attached Files Attached Files

  2. #2
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,139
    Rep Power
    733

    Re: TBEM - Event manager module

    Thanks a lot Mike,

    this kind of event oriented game programming will be something new for me, and I am looking forward to it.
    The thinBASIC functions and module links are very poweful combo! I am sure it will start new era of thinBASIC games


    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  3. #3

    Re: TBEM - Event manager module

    Ok Eros, I uploaded a new version and added your requested command.

  4. #4
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,139
    Rep Power
    733

    Re: TBEM - Event manager module

    Hi Eros,

    I think this module deserves separate forum section, else this post will get lost in sea of new messages, and that would be a pity.


    Thanks,
    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  5. #5
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,795
    Rep Power
    10

    Re: TBEM - Event manager module

    Already done ;D

    http://community.thinbasic.com/index.php?board=154.0

    I'm just now moving posts in there.
    Michael is moderator.

    Ciao
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  6. #6

    Re: TBEM - Event manager module V1.03

    Updated the module because auf a serious pointer bug. Please download it from the first post.

  7. #7
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    68
    Posts
    3,869
    Rep Power
    404

    Re: TBEM - Event manager module V1.03

    Thanks Mike for the update!
    Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
    Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server

  8. #8

    Re: TBEM - Event manager module V1.03b

    Hi,

    please download the latest release. There was some nasty timing probs when you used several self repeating events.

    Thanks to Eros for testing.

  9. #9
    Senior Member Lionheart008's Avatar
    Join Date
    Sep 2008
    Location
    Germany, Bad Sooden-Allendorf
    Age
    51
    Posts
    939
    Rep Power
    109

    Re: TBEM - Event manager module V1.03b

    Hi dear Michael :-)

    .. question about your "TBEM"... Can you explain to me what is the content of the 'event manager module'? Do you need it for "Games"? ... your example is only useful for the console?...or may be a good thing for window gui too? perhaps it's rubbish I told, but I am only curious to understand what is TBEM ;-))

    best regards, hope your scripts are running well with the new thinBasic version,

    greetings with a lot of sunshine from centre of germany, lionheart
    you can't always get what you want, but if you try sometimes you might find, you get what you need

  10. #10

    Re: TBEM - Event manager module V1.03b

    Hi lionheart,

    you can use TBEM for everything that needs to be done repeatly/automatically. There are 2 main parts of the event module, events and triggers. First you have to tell the modul which event functions exists on which trigger they can react. Triggers are fired by your code, when ever you need them. TBEM then looks if some events needs to be processed and will call the specific functions.

    I had mostly games in my mind but maybe it is good for windows apps too. But don't confuse TBEM-events with windows events. Two different things. And they are not console only. It was just a quick sample I came up with.

    I will will try to come up with more samples so it will be easier to understand.

    Thanks, yes it is sunny here too. But enjoy it as they predict that it will be the last warm days in the year.

Page 1 of 3 123 LastLast

Similar Threads

  1. TBEM sample - Add an event
    By Michael Hartlef in forum TBEM module - thinBasic Event Manager module
    Replies: 0
    Last Post: 18-10-2008, 19:07

Members who have read this thread: 1

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •