GLBasic forum

Main forum => Tutorials => Topic started by: Steinbock on 2009-Mar-25

Title: Discussion forum for Horizontal Shooter Tutorial
Post by: Steinbock on 2009-Mar-25
Here you can post your questions and suggestions according to the Horizontal Shooter Tutorial
Title: Re: Discussion forum for Horizontal Shooter Tutorial
Post by: Enigma on 2009-Jul-20
Is there any chance that you can give us the map editor so we can play about with the levels and add new things to it?
Title: Re: Discussion forum for Horizontal Shooter Tutorial
Post by: Steinbock on 2009-Jul-21
Of course!   =D
Original sourcecode is written in Delphi. Please give me a week or two, so i can
rewrite it in GLBASIC. I think this makes more sense.
Title: Re: Discussion forum for Horizontal Shooter Tutorial
Post by: Enigma on 2009-Jul-21
That would be awesome, thanks :)
Title: Re: Discussion forum for Horizontal Shooter Tutorial
Post by: Steinbock on 2009-Jul-27
Simple tilemap editor is now available.
See "EDIT" in first post topic http://www.glbasic.com/forum/index.php?topic=2950.0
Title: Re: Discussion forum for Horizontal Shooter Tutorial
Post by: Enigma on 2009-Jul-27
Thanks for the map editor :) It seems that the code for the editor is not in the zip though.
Title: Re: Discussion forum for Horizontal Shooter Tutorial
Post by: Steinbock on 2009-Jul-27
Ok. Should be fixed.  :whistle:
Title: Re: Discussion forum for Horizontal Shooter Tutorial
Post by: Armoured on 2009-Sep-27
Hi
Ehm, where is the first part of the tutorial?  :whistle:
Title: Re: Discussion forum for Horizontal Shooter Tutorial
Post by: Steinbock on 2009-Sep-28
If you mean an attached "ZIP-code", then there is none.
In the first part it's a small "motivation" to do a little own work.  =D
Title: Re: Discussion forum for Horizontal Shooter Tutorial
Post by: Armoured on 2009-Sep-28
Quote
If you mean an attached "ZIP-code", then there is none.
In the first part it's a small "motivation" to do a little own work.

Then you haven't made a "tut Part 1.zip"?
I can download from the first post only the editor
Title: Re: Discussion forum for Horizontal Shooter Tutorial
Post by: Steinbock on 2009-Sep-29
That's the whole truth.  :good:
Title: Re: Discussion forum for Horizontal Shooter Tutorial
Post by: okee on 2010-Feb-12
Thanks for that, very useful also nice to see how other people
structure their programs.


okee
Title: Re: Discussion forum for Horizontal Shooter Tutorial
Post by: Manu Segura on 2010-Jul-28
Hello all,

Amongst other doubts I have with the tutorial, the most important one that comes to my mind right now is:

Can anyone explain me how the .evt file works, how should I edit it to make things happen in the level?

Thanks in advance for the help!
Title: Re: Discussion forum for Horizontal Shooter Tutorial
Post by: Steinbock on 2010-Jul-29
Hello

It is explained in tutorial no. 6:

in level00.gbas the objects manually. But in a completed game are much more required, and it would be very laborious to call every single object separatly. Therefore we read out the datas from a predefined file level00.evt. For this we must expand our existing event-type (TEvent).

Code: (glbasic) [Select]
        IX%             =   0
        ID%[256]
        Pos%[256]
        X%[256]
        Y%[256]

IX is a pointer to the actual listentry, ID is the objectID, Pos is the scrollposition WHEN the object shall appear and X,Y the position WERE the object shall appear.
With
Code: (glbasic) [Select]
    // init events
    OPENFILE(1,"./isdo/level00.evt",TRUE)
    FOR p=0 TO 254
        READUWORD 1,val
        Event.Pos[p]=val
    NEXT
    FOR p=0 TO 254
        READUWORD 1,val
        Event.ID[p]=val
    NEXT
    FOR p=0 TO 254
        READUWORD 1,val
        Event.X[p]=val
    NEXT
    FOR p=0 TO 254
        READUWORD 1,val
        Event.Y[p]=val
    NEXT

in level00.gbas we load these datas into our eventlist. The request when a object shall appear, we do in the subroutine EventHANDLER in library.gbas.
Code: (glbasic) [Select]
//=============================================================================
  SUB EventHANDLER:
//=============================================================================

LOCAL   ix%,typ%

    ix=Event.IX
    IF ScrollX=Event.Pos[ix]
        SELECT Event.ID[ix]
            CASE ID_ENEMY1 TO ID_ENEMY2
                ObjectADD(Event.ID[ix],Event.X[ix],Event.Y[ix])
        ENDSELECT
        INC Event.IX,1
    ENDIF

ENDSUB // EventHANDLER

First we request the current index in the eventlist, then we check the type and add the corresponding object to the scene. The rest goes as if by magic.


Today or tomorrow i will upload a simple eventeditor :)
Title: Re: Discussion forum for Horizontal Shooter Tutorial
Post by: Manu Segura on 2010-Jul-29
That would be great, thanks Steinbock.
Title: Re: Discussion forum for Horizontal Shooter Tutorial
Post by: Steinbock on 2010-Jul-29
OK! Here is a "very basic" eventeditor:

(http://www.qpic.ws/images/tfo23738.png)

I have also attached a sample eventfile.

If there are still open questions, please ask. :)

[attachment deleted by admin]
Title: Re: Discussion forum for Horizontal Shooter Tutorial
Post by: Manu Segura on 2010-Aug-01
Thanks Steinbock, will try this later on.

BTW, you're closer than you think from a complete "Horizontal Shooter Construction Kit" LOL

Cheers,
Title: Re: Discussion forum for Horizontal Shooter Tutorial
Post by: Manu Segura on 2010-Aug-20
Hello again,

I am trying to adapt the engine to a 480x320 resolution (your guess is right: iPhone resolution) but I am "still" not an expert, so I would like to have some advice on what should I take in consideration while doing this.

I am starting with the tile editor, being more or less successful with adapting the resolution but the tiles are not being transported properly in the destination position.

More questions are: how can I use source png tiles bigger than 256 tiles?

Also, a event file handling more than 256 events would be great. My plans are to have big action there :)

Thanks in advance and have a nice weekend!

Greetings from Spain ;)
Title: Re: Discussion forum for Horizontal Shooter Tutorial
Post by: DariusArgent on 2011-Oct-18
GP2X version is deleted on zshare. =(