SlimShady Posted October 4, 2004 Share Posted October 4, 2004 (edited) The topic title is clear.If you're bored, here's a story why...This morning at school, a friend showed me a game he made.Really interesting and great that you can create a working game by typing code.Makes you wonder how many lines of code Doom III has.Anyways, he told me he tried to create a Tetris game.And he gave up because it's too hard and alot of work/code.Then I thought: Great idea! A tetris clone!So I started working on it.1. I assigned HotKeys to the arrow keys.2. I created a label control with a black background. It became the long bar.3. using the arrow keys, I could move the label4. Then I added checks so the label didn't move outside the window5. I added another 'object'. A 2x2 square.6. When an object hits the ground, another object should appear at the top7. Two dilemmas: 1. I can't rotate the labels 2. I can't create the orginal Tetris objects using labels.For 2nd dilemma, I made images.(I think I'll make an array so I know when it's an image or label.)Can you add the ability to rotate a control?Edit:Removed typos Edited October 4, 2004 by SlimShady Link to comment Share on other sites More sharing options...
Valik Posted October 4, 2004 Share Posted October 4, 2004 I'm sure its possible by overriding the painting process, but I don't recall ever seeing a simple API call to change the orientation of a control. In short, I wouldn't count on seeing that as doing custom/special things with the painting is just a mess. Link to comment Share on other sites More sharing options...
Josbe Posted October 4, 2004 Share Posted October 4, 2004 mmm...interesting.Maybe, 2nd. dilemma:You could 'construct' every piece with several labels. (An array)...and to manipulate the positions. Although really it requires more code than simply to rotate an image... Good luck! AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta Link to comment Share on other sites More sharing options...
Josbe Posted October 4, 2004 Share Posted October 4, 2004 I'm sure its possible by overriding the painting process, but I don't recall ever seeing a simple API call to change the orientation of a control. In short, I wouldn't count on seeing that as doing custom/special things with the painting is just a mess.<{POST_SNAPBACK}>You're talking with a call from DllCall? AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta Link to comment Share on other sites More sharing options...
SlimShady Posted October 4, 2004 Author Share Posted October 4, 2004 You say "several labels"... That requires more thinking, because currently it's just one control (image or label) that moves to the bottom. Fnishing this, is a real challenge. But this is nice when I'm bored and it's raining outside... Link to comment Share on other sites More sharing options...
Valik Posted October 4, 2004 Share Posted October 4, 2004 You're talking with a call from DllCall? <{POST_SNAPBACK}>No, I'm talking internal. Link to comment Share on other sites More sharing options...
SlimShady Posted October 4, 2004 Author Share Posted October 4, 2004 I knew it would be difficult to do... And I'm using ControlGetPos in a very sloppy way atm. A GUI function for it would help me alot. Link to comment Share on other sites More sharing options...
redndahead Posted October 5, 2004 Share Posted October 5, 2004 I would use pictures and move the control when you want to rotate it update it with a new picture that has that orientation. red Link to comment Share on other sites More sharing options...
SlimShady Posted October 5, 2004 Author Share Posted October 5, 2004 (edited) I would use pictures and move the control when you want to rotate it update it with a new picture that has that orientation.red<{POST_SNAPBACK}>I'm doing that now.But I have a feeling that ControlGetPos caused a new problem.The width of the control is incorrect.I'm going to test a little to be sure.Edit:I forgot that $Pos[3] contains the height of the control instead of the width. Edited October 5, 2004 by SlimShady Link to comment Share on other sites More sharing options...
Josbe Posted October 5, 2004 Share Posted October 5, 2004 A small "proof of concept" for a Tetris.(I think) If you want take a look, see attachment.AKATetris.au3 AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta Link to comment Share on other sites More sharing options...
SlimShady Posted October 6, 2004 Author Share Posted October 6, 2004 @josbe: Looks really good. The code is very advanced. I'll use it for future reference. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now