Results 1 to 10 of 16

Thread: Math-O-Spheres

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    You're right about things being a mess, I was planning to clean them up after I had everything working.

    1.) Thanks.

    2.) That was a temporary measure; I actually wanted to iterate through a length: nine (0 through 8 ) list randomly 128 times, at which point the grid would be filled. I haven't done that mainly because I'm currently working on the "chain" functionality of the game.

    3.) I have the code for that, but haven't finished implementing it.

    4.) Thanks.

    5.) I was planning to make the game time around one minute, but have it set to fifteen seconds from when I was testing to make sure the Game Over events were working. Waiting all that time just for the game to end seemed like a waste.

    6.) I've already done that; the current length is only temporary. Once I've set the final length, the bar will start full.

    7.) Didn't know that. Thanks.

    You've been more than helpful. I really appreciate you taking time out of your day to do this.
    Last edited by sewing0109; 13-05-2014 at 08:19 PM. Reason: Random smiley where the 8 and the ) met

  2. #2
    No problem. If you will have any other questions don't be shy.

  3. #3
    I'm still not sure how to iterate over the imagelist.

    The code I have is...

    index := ARow * grdPlayField.ColCount + ACol;
    grdPlayField.Canvas.Brush.Color := clMaroon;
    grdPlayField.Canvas.FillRect(Rect);
    imlSpheres.Draw(grdPlayField.Canvas,Rect.Left,Rect .Top,index, True);
    if (gdFocused in State) then
    begin
    grdPlayField.Canvas.DrawFocusRect(Rect);
    end;


    ...It works for simply displaying the nine items on the grid in the appropriate cells, but I can't figure out how to tell Delphi to keep assigning the elements until the grid is full.

  4. #4
    You're only showing what you do with 1 element. Is there a for or while structure we can take a look at? Iterating 2D table is really easy
    Code:
    var i, j: integer;
    ...
    for j:=0 to RowCount-1 do
      for i:=0 to ColCount-1 do
      begin
        // Do something with element[i, j] ...
    
      end;

Tags for this Thread

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
  •