xboxscene.org forums

Pages: 1 2 [3] 4

Author Topic: Tetris  (Read 2437 times)

geniusalz

  • Archived User
  • Hero Member
  • *
  • Posts: 1635
Tetris
« Reply #30 on: January 03, 2004, 03:54:00 PM »

wink.gif

Well, maybe you could expand the SET statement to allow expressions.

SET y=(%x%+3)/2

As opposed to

SET y=%x%
ADD y 3
DIV y 2

You get my point.

Similarly, allow expressions in brackets as parameters.  Shouldn't be too hard to implement once the above is done.

BOX (%x%*3) (%y%+2) 10 10 blah blah etc.
Logged

BenJeremy

  • Archived User
  • Hero Member
  • *
  • Posts: 5645
Tetris
« Reply #31 on: January 03, 2004, 03:57:00 PM »

QUOTE (geniusalz @ Jan 3 2004, 07:54 PM)
And deceptively easier to code? wink.gif

Well, maybe you could expand the SET statement to allow expressions.

SET y=(%x%+3)/2

As opposed to

SET y=%x%
ADD y 3
DIV y 2

You get my point.

Similarly, allow expressions in brackets as parameters.  Shouldn't be too hard to implement once the above is done.

BOX (%x%*3) (%y%+2) 10 10 blah blah etc.

Yeah, I might be able to swing expressions.

So what do you think about the [] addition? I'm working on the XML stuff (%#xml.xx.xx% at the moment, along with getting the file manager going.

Logged

geniusalz

  • Archived User
  • Hero Member
  • *
  • Posts: 1635
Tetris
« Reply #32 on: January 03, 2004, 04:00:00 PM »

[] is pretty sweet.  As I've said, no more makeshift arrays.
Logged

geniusalz

  • Archived User
  • Hero Member
  • *
  • Posts: 1635
Tetris
« Reply #33 on: January 03, 2004, 05:58:00 PM »

QUOTE (BenJeremy @ Jan 3 2004, 12:48 PM)
Well, I've added LINE (will be in next update) to the draw set, but image is a bit more complicated. I am also looking at a scheme where you can reference back to Draw List objects and manipulate them withouth having to redefine the draw list (handy for images, when sprites are working)

Some sort of ID?

SETFUNC boxID BOX 1 1 100 100
SETPOS %boxID% 2 2 100 100
DESTROY %boxID%

same with image
Logged

BenJeremy

  • Archived User
  • Hero Member
  • *
  • Posts: 5645
Tetris
« Reply #34 on: January 03, 2004, 06:16:00 PM »

QUOTE (geniusalz @ Jan 3 2004, 09:58 PM)
QUOTE (BenJeremy @ Jan 3 2004, 12:48 PM)
Well, I've added LINE (will be in next update) to the draw set, but image is a bit more complicated. I am also looking at a scheme where you can reference back to Draw List objects and manipulate them withouth having to redefine the draw list (handy for images, when sprites are working)

Some sort of ID?

SETFUNC boxID BOX 1 1 100 100
SETPOS %boxID% 2 2 100 100
DESTROY %boxID%

same with image

Hmmm... that's an idea... I have to cogitate on it though. Internally, I create a 'disposable' list without a reference back to it. For references, I need to add a reference count or something to prevent the deletion of drawing objects that are still being used.  blink.gif
Logged

geniusalz

  • Archived User
  • Hero Member
  • *
  • Posts: 1635
Tetris
« Reply #35 on: January 03, 2004, 06:55:00 PM »

Well, shouldn't be too hard putting anything marked as 'undisposable' (i.e. created using the SETFUNC command) into a referenced linked list or something, while still keeping the old system for disposable objects.
Logged

geniusalz

  • Archived User
  • Hero Member
  • *
  • Posts: 1635
Tetris
« Reply #36 on: January 05, 2004, 05:53:00 PM »

New version
-High scores
-Settable brightness (and saves too)
-Pause menu
-Menu script included that can be used for any purpose.

Tetris 1.0c

The game gets sorta clunky as its about to end.  This is because redrawing the board takes longer the more boxes there are.

Here are the benchmarks using $timer$
-Empty board about 60 ms to draw
-Full board about 120 ms to draw

However, if the FOR loop that draws all the 'stuck' pieces is removed, drawing time goes down to 7 ms only, no matter how full the board is.

This is a big indication of the need for 'permanent' objects, even if they're not referencable (A clearscreen command should clear everything)
Logged

BenJeremy

  • Archived User
  • Hero Member
  • *
  • Posts: 5645
Tetris
« Reply #37 on: January 05, 2004, 07:02:00 PM »

wink.gif
Logged

BenJeremy

  • Archived User
  • Hero Member
  • *
  • Posts: 5645
Tetris
« Reply #38 on: January 05, 2004, 07:06:00 PM »

On second thought.... I uploaded an update tonight. Give it a whirl. It has the cacheing implemented for XML nodes. See if you notice a speedup in the loading time, too (seems to be faster, but it's hard to tell on my crappy about-to-die HD)

(Save the last update, though...)

Logged

geniusalz

  • Archived User
  • Hero Member
  • *
  • Posts: 1635
Tetris
« Reply #39 on: January 05, 2004, 07:33:00 PM »

Can't really see the difference in loading times.

The drawboard in tetris seems about 5 ms faster (using the timer again), but nothing major.
Logged

geniusalz

  • Archived User
  • Hero Member
  • *
  • Posts: 1635
Tetris
« Reply #40 on: January 05, 2004, 07:39:00 PM »

Is the timer reset on reboot?  If its not, it could be used to time reboots.
Logged

BenJeremy

  • Archived User
  • Hero Member
  • *
  • Posts: 5645
Tetris
« Reply #41 on: January 06, 2004, 01:10:00 AM »

Well, the message logger now "zeros out" the time base ont he first message out, meaning it no longer counts the actual time it took to go through the bootup animation and stuff.

Logged

oswald

  • Archived User
  • Sr. Member
  • *
  • Posts: 434
Tetris
« Reply #42 on: January 06, 2004, 07:01:00 PM »

smile.gif
Logged

koldfuzion

  • Archived User
  • Hero Member
  • *
  • Posts: 1226
Tetris
« Reply #43 on: January 06, 2004, 07:37:00 PM »

QUOTE (oswald @ Jan 7 2004, 05:01 AM)
the uninitiated would see this thread as BenJeremy tweaking MXM to run Tetris faster smile.gif

dont you know that tetris powers the Universe?  therefore, any tweaking to tetris makes everything run faster!

I ran 1.5 miles in 6 minutes today!  





Not.  biggrin.gif
Logged

geniusalz

  • Archived User
  • Hero Member
  • *
  • Posts: 1635
Tetris
« Reply #44 on: January 06, 2004, 08:48:00 PM »

You did NOT run 1.5 miles in 6 minutes today?
Clearly not enough tweaking

BJ, back to work!
Logged
Pages: 1 2 [3] 4