He'll now have to update Tetris AGAIN.
WIP Build 1177 is now up.
New Function:
-- HandleType
.....Gets type of handle, 0 if not a valid handle.
New Commands:
-- Image <Handle> <X> <Y> <Width> <Height>
.....Used with BeginDraw, allows use of Images loaded with LOADIMAGE to be used in an ActionDraw List
-- LOADIMAGE <Handle> <Path>
.....Load an image. May wait up to 5 seconds for image to load from cache.
-- CLOSEIMAGE <Handle>
Now it means he can add cool background images!!
| CODE |
; In the startup portion of his script:
LOADIMAGE BackImage CoolBackgrndImage.jpg
; Later in the script, to use the image:
:DrawBoard BeginDraw IMAGE BackImage 0 0 640 480
|
Sweet!
This is for normal scripts, not Dialogs right?
And is it like skinning where an image can be a video too? Cause that would be cool too if it is.
| QUOTE (flattspott @ Feb 22 2004, 06:35 PM) |
Sweet!
This is for normal scripts, not Dialogs right?
And is it like skinning where an image can be a video too? Cause that would be cool too if it is. |
Should be OK for video, but I didn't test that.
Yes, it is for scripts....
I read the title, and I was like WTF?
And then I read inside, and I'm like w00t
Image someling like Tetris with a video behind it. That would be crazy.
I was thinking a minute ago. This ActionScripting is really remarkable. Not only have you made your own scripting language but, in a way, it's like you found a way to have multiple processes going on on the Xbox.
| QUOTE (geniusalz @ Feb 22 2004, 05:43 PM) |
I read the title, and I was like WTF? And then I read inside, and I'm like w00t |
YEah I though you posted it G-Dub, cause I was lookin at the main forum view and saw the title. I was wonderin "WTF, what happened to G-Dub" then I saw it was by BJ and knew it meant you had to re-write/code somethin...

EDIT: Forgot, awsome news, Images in Actionscripts this should be really cool, now, G-Dub, can include those awsome Russian wraparound the board pics for tetris
And is this how we're to use the HandleType
SetFunc whatisit HandleType MyDialog
and
SetFunc whatisit HandleType TestXML
| QUOTE (flattspott @ Feb 22 2004, 06:47 PM) |
And is this how we're to use the HandleType
SetFunc whatisit HandleType MyDialog and SetFunc whatisit HandleType TestXML |
Yes....
1 == HTYPE_FILE
2 == HTYPE_UIOBJECT
3 == HTYPE_IMAGE
4 == HTYPE_XMLOBJECT
1 == HTYPE_FILE = ????
2 == HTYPE_UIOBJECT = Dialog
3 == HTYPE_IMAGE = Image
4 == HTYPE_XMLOBJECT = XML
What kind of file needs a handle? I must of missed that one.
This post has been edited by flattspott: Feb 22 2004, 10:04 PM
Handles for reading and writing files, of course, but that's broken at the moment, so you can't verify those handles yet.
The other types can be checked, though.
Now i just need someone to design a kickass background. flex, kf, boomboom, Anyone wanna volunteer?
Here's a screenshot of the layout
(IMG:http://individual.utoronto.ca/mueez/mxmskinner/tetris.png)
EDIT: If each block was an image, would it affect the speed significantly?
And what about permanent 'ActionDraw Lists' ?
i.e.
BeginDraw Permanent
Box 1 1 1 Black
EndDraw
Anything specified as 'permanent' will just add to the permanent drawlist. i.e. will not clear throughout the life of the script.
Anything else (non-permanent) will behave as normal.
The application to tetris would be that all pieces that are 'dropped' go into the permanent drawlist, so the whole board doesn't need to be redrawn each time anything changes. This will also be quite useful for other games as well.
This post has been edited by geniusalz: Feb 22 2004, 10:32 PM
Well, I've mulled the idea of accessing an ActionDraw list, but I haven't come up with anything workable - yet.
As for using images, it might actually be a bit faster- but you'd need all the rotations defined, as I don't have that little mod in yet
Let me think about that, though. The images are loaded, then using them is pretty simple, since the texture to render it is always available.
Here was my image test, BTW, using Tetris with a background image:

A pic for each piece wouldn't work, because then there's no way to cut out part of a block (when lines are completed)
So the only way it can work is if each little square is a pic.
| QUOTE (geniusalz @ Feb 22 2004, 07:54 PM) |
A pic for each piece wouldn't work, because then there's no way to cut out part of a block (when lines are completed)
So the only way it can work is if each little square is a pic. |
You are correct, sir!
Didn't think about that.
Did you change anything in the way boxes (and their borders) are rendered? Because now the boxes don't look 3D like they did.
| QUOTE (geniusalz @ Feb 23 2004, 01:59 AM) |
Did you change anything in the way boxes (and their borders) are rendered? Because now the boxes don't look 3D like they did. |
Well, I cleaned up the way boxes, lines and text are rendered.
Perhaps I can add something to make it render them "anti-aliased" and off-center again.
(IMG:http://www.allxboxskins.com/temp/Tetriss.jpg)
Full Image (262k)
This post has been edited by koldfuzion: Feb 23 2004, 04:23 PM
Now if you could trigger .wma or .wav files from actionscripts.... TETRIS would be complete. I have copies of the original GameBoy TETRIS music in .wma format, if you could tigger or incorporate the .wma into the actionscript, that would be awsome...
Well wmv work in the dialogs
| QUOTE (koldfuzion @ Feb 23 2004, 12:21 PM) |

http://www.allxboxskins.com/temp/Tetris.jpg |
Awesome!
I'll be adding sound shortly.
Cool cool. Now all geniusalz need to do is add some different modes.
For example
A Normal mode where theres levels and each one has more and more lines you have to get to before you get to the next level (like the real tetris)
A Black and White mode where all the pieces are the same color
Just some ideas.
| QUOTE (BenJeremy @ Feb 23 2004, 07:22 PM) |
I'll be adding sound shortly. |
BJ, you the man....
| QUOTE (Yuyu @ Feb 23 2004, 09:16 PM) |
| QUOTE (BenJeremy @ Feb 23 2004, 07:22 PM) | I'll be adding sound shortly. |
BJ, you the man.... |
It might actually be a day or two, though.... today is a birthday, and I've worked a late day.
Oooooo Skinnable tetris
| QUOTE (geniusalz @ Feb 23 2004, 09:20 PM) |
Oooooo Skinnable tetris |
Yes.... you should be able to re-use handles, but keep in mind that the Action Draw list is rendered in a multitasked thread, so you either have to switch to another list without the image, or use a second handle and swap back and forth.
You could do things like change the image after so many lines (Strip Tetris, just like in the Japanese arcades...)

Just to get things in the mood....
| QUOTE (BenJeremy @ Feb 23 2004, 08:27 PM) |
You could do things like change the image after so many lines (Strip Tetris, just like in the Japanese arcades...)
 Just to get things in the mood.... |
Good call Bj, very good call... NOw, the music , the imagery, the gameplay, its all there...
Oh yeah a Locked mode will be cool too. (Were you can't rotate the pieces)
Well, 1180 adds more goodies.
LoadSound <Handle> <File>
....Loads a sound resource to be played
CloseSound <Handle>
....Closes sound resource, handle is available for reuse.
PlaySound <Handle>
....Play sound from sound resource handle
LoadDialogFromXML <UIHandle> <XMLHandle> <XMLLocation>
....Load a dialog from the node indicated
I haven't tested, so use this version at your own risk. 
Should also fix that "desc" -> "descr" issue with context items.
| QUOTE |
Yes.... you should be able to re-use handles, but keep in mind that the Action Draw list is rendered in a multitasked thread, so you either have to switch to another list without the image, or use a second handle and swap back and forth.
|
Switch to another list without the image?
I get the part about the second handle
| QUOTE |
You could do things like change the image after so many lines (Strip Tetris, just like in the Japanese arcades...)
|
Ummm..... I think I'll pass
| QUOTE (geniusalz @ Feb 23 2004, 11:14 PM) |
| QUOTE | Yes.... you should be able to re-use handles, but keep in mind that the Action Draw list is rendered in a multitasked thread, so you either have to switch to another list without the image, or use a second handle and swap back and forth.
|
Switch to another list without the image? I get the part about the second handle | QUOTE | You could do things like change the image after so many lines (Strip Tetris, just like in the Japanese arcades...)
|
Ummm..... I think I'll pass |
Actually, the way I set it up, it might be OK to close the image, then load another with the same handle, because when creating the draw list, it takes the texture object and performs an "AddRef" - which means that the Draw List has a say in when the texture itself goes away. Closing the image preforms a "release" on it's part, and reuses the name and such, but the raw texture is still hanging out in the draw list, until you rebuild it.
I just tried out KF's Tetris screen, and it rocks. Just need translucency on the main board.
Now just add the sounds!

As for the 3-D effect, give me another day to tinker around. I got stuck with a Japanese engineer who just flew out - wouldn't you know it, we get to the bench and the nasty bug we've been having problems with never showed up!! Now it looks like a hardware issue, but hopefully, I won't have to run tomorrow to the bench to find out. Um, sorry for ranting, but all that was intended to say, "I didn't get a lot fo time today, and tomorrow, I hope to have a little time to take care of more stuff"
I will also soon add ZIP/UnZip and UnRar functionality. This will be a part of the plug-and-play stuff. All plug-and-play modules will be zips.
If the new http protocol is done, project content manager can be started
Awesome BJ
Here's a link to a file that was free for download on Dj Scribble's site awhile back and yes it is a free-to-distibute-as-you-want file... Its a TETRIS Rave Remix... You can play good ole Tetris with some tunes...
TETRIS TECHNO
You will need to right-click and save as...
Tried it with a pic for each block, and the response is too slow, unplayable, especially when the board is full.
Geniusalz... I fixed the IF# block problem.
It had to do with the fact that when I encountered a non-block IF statement, while scanning the program for the ELSE or ENDIF, it didn't advance the line count, thus getting stuck looking at the same line forever. 
Fixed though.... so let's see what Tetris will look like now!!
Thanks for taking the time to debug. You'll see it soon (little busy)
geniusalz, have you tried using four lines (lighter, darker colors) to give it a 3d effect?