Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Modifing TBackgroundSprite

  1. #1

    Modifing TBackgroundSprite

    Hi, sorry my but english.

    I have a TBackgroundSprite and i modifing in execution. Is a car game and i want cars paint the track when brake.

    I modify surface, but not persistent:

    DXDraw.Surface.Canvas.Pixels[Player.X,Player.Y] := clblack;

    my code:
    [pascal]

    SpriteFondo : TBackgroundSprite;

    .......

    SpriteFondo := TBackgroundSprite.Create(DXSpriteEngine.Engine);

    ........

    SpriteFondo.SetMapSize(1024,76;
    SpriteFondo.Image := DXImageList.Items.Find('Circuito');
    SpriteFondo.Tile := True;
    SpriteFondo.Z := 0;

    .........

    DXSpriteEngine.Engine.X := -Player.X + DXSpriteEngine.Engine.Width div 2;
    DXSpriteEngine.Engine.Y := -Player.Y + DXSpriteEngine.Engine.Height div 2;

    .........

    DXDraw.Surface.Fill(0);
    DXDraw.BeginScene;
    DXSpriteEngine.Draw;
    ..................................
    DXDraw.EndScene;
    with DXDraw.Surface.Canvas do
    begin
    .........
    Relase;
    end;
    DXDraw.Flip;[/pascal]

    the games is: www.miniracingonline.com

    Thanks.
    www.kotai.es
    www.remakesonline.com -> Nemesis Online & Bubble Bobble Online & Castlevania Online & Penguin Adventure Online
    www.miniracingonline.com

  2. #2

    Modifing TBackgroundSprite

    Looked at screenshots and... wow! :shock: That's a nice game!! It's been too long (5+ years) since I used DelphiX so can't help you
    [size=9px]
    Lo que si, veo que el juego esta en espaA±ol... no esta nada mal! Ya quiero jugarlo...[/size]

  3. #3

    Modifing TBackgroundSprite

    Welcome to PGD!

    Your game sure looks mighty nice! Im curious how did you do the background. Are those large imagemaps?

    Anyhow, your question:
    Changing de pixels of the surface like you suggested is certainly an option, but a very slow one a that, so not very favourable. Alternative you could draw a line between the point where braking starts and where it ends.
    Drawback of this approach is that you can't create curves very easily.

  4. #4

    Modifing TBackgroundSprite

    Your game looks pretty good but it is still not very user friendly.

    Took me a while to realise I could get the program use English.

    It crashed twice during start up. Black screen with the music going and them bang. Send report to microsoft.

    I found the setup screens very busy - especially if you just want a quick start. An instant action option would be great.

    The track editor locked up on first go. I opened a track and that was that I had to ctrl-alt-del to kill the task.

    I am using ATI 9700 Pro with recent drivers, windows XP with 1 gig RAM etc etc. Just in case you are wondering.

    However, I think I will just have another go at racing.
    The views expressed on this programme are bloody good ones. - Fred Dagg

  5. #5

    Modifing TBackgroundSprite

    Hi.

    The background are large image (1024 x 768 to 8192x4096)

    The problem is that paint surface the change is not persistent. I was modify background, not paint over background. A¬ø How I can modify background ?


    Since I change to unDelphiX I have a lot of problems when close game: "exception class EAccessViolation..." and "external exception....". With DelphiX (hori) i not have problems (but not compression in sockets and directx 6)

    The version 0.81A is stable but 0.81E or latter not.
    The track editor is more slow if you load a big circuit, please wait.


    Asqs:

    1) how can I modify background to make braking marks persistent? (without painting it in each frame)

    2) anybody knows how to close a Delphix application without closing errors?

    Close Procedure:
    [pascal]
    procedure TF_Principal.FormClose(Sender: TObject; var Action: TCloseAction);
    begin
    try
    if Cerrando then
    begin
    Action := caNone;
    exit;
    end;
    Cerrando := True;
    DXTimer.Enabled := False;
    DXDraw.Finalize;
    DXDraw.Destroy;
    DXSound.Finalize;
    DXSound.Destroy;
    DXSpriteEngine.Destroy;
    DXImageList.Destroy;
    DXPlay.Destroy;
    DXTimer.Destroy;
    DXInput.Destroy;
    except
    end;
    end;
    [/pascal]

    Thanks
    www.kotai.es
    www.remakesonline.com -> Nemesis Online & Bubble Bobble Online & Castlevania Online & Penguin Adventure Online
    www.miniracingonline.com

  6. #6

    Modifing TBackgroundSprite

    a screenshot of the game:



    Kotai.
    www.kotai.es
    www.remakesonline.com -> Nemesis Online & Bubble Bobble Online & Castlevania Online & Penguin Adventure Online
    www.miniracingonline.com

  7. #7

    Modifing TBackgroundSprite

    Quote Originally Posted by kotai
    Hi.
    1) how can I modify background to make braking marks persistent? (without painting it in each frame)

    2) anybody knows how to close a Delphix application without closing errors?
    About 1): what about using for braking marks something like particles? You could redraw only when visible and write an array of coordinates, in order to redraw when you reload the level.

    About 2): do you have tried using free instead of destroy?

    Some considerations: your game looks wonderful! :shock: Maybe you should try to optimize backgroud. Splitting it in smaller blocks and dynamically loading it could waste a smaller amount of resources, IMHO
    Get your fpc4gba copy now!
    Get your fpc4nds copy now!

  8. #8

    Modifing TBackgroundSprite

    I definatley agree, you should never be calling Destroy/Finalize directly. Calling the class' Free method is the correct way of freeing any object and this will call Destroy/Finalize internally at the right time.
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  9. #9

    Modifing TBackgroundSprite

    Hi there,

    Just tried running your program at work and it won't start up here either. You must have some serious issues still in your game.

    As for delphix. I find that you have to free some of the components yourself e.g.

    dxsound1.free; dxwavelist1.free; etc

    That works for me.



    Computer that didn't work; win xp, 768 ram, fx 5200 ultra dx 9.

    Computer that did work AMD 3200 with NVIDIA GeForce 6600 GT

    ---

    Observations:
    1. I hate the way that way that the car just dissapears when going under bridges and sign. Looks terrible. Why not draw a bitmap over the top of the car.

    2. We all agree at work you need a quick race option.

    3. Rotating of the car is not very smooth.

    4. Drive to top left hand corner, turn around and drive back to start line and hey presto lap won.
    The views expressed on this programme are bloody good ones. - Fred Dagg

  10. #10

    Modifing TBackgroundSprite

    In regards to the drawing question.
    Make sure you draw on the background surface, not dxdraw surface.
    Have a look at this thread and check Crisp_N_Dry or my answer there to IaxFenris' question, i believe it's what you need.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

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