Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Pentris - a Tetris clone

by Crian (Chaplain)
on Aug 24, 2004 at 14:40 UTC ( #385402=note: print w/replies, xml ) Need Help??


in reply to Pentris - a Tetris clone

Yes, the possibility to switch the grid on and off is (or was) not completed, the withgrid value only was a preparation for doing so.

Could you please send me the diff to the original pentris.pl (to crian AT duehl DOT de), because I worked at the code for myself since my last post here, then I can put your changes into it. And perhaps I could add a language option to the menue as well.

Many thanks for enabling that option, I just had lost it out of my mind =)

"Default height is too large for my monitor (1152x864) so I guess you must run 1280x1024+" Yes right, I wrote in the history window how to change it, but in german. Just lower the values of 'colpix' and 'rowpix' in the global hash %C at top of the code.

Perhaps I should add a possibility to change this out of the menue.

UPDATE: I changed the calculations myself, so that the grid can be switched on and off. Per default grid is on, if you start the game with the parameter 'nogrid', the grid will disappear.

Perhaps I add a switch in the menu too, but therefor i would have to start the program all over again, because the game field is shown already at that time.

I will upload the code later this evening (it's not possible at the moment) and update the link above.

UPDATE: I wrote a menue entry that toggled the grid and a function to toggle it at every moment, but it is buggy at the moment and i comment out the Menue entry and the binding. Perhaps I can add it later, but I hav no more time at the moment.

UPDATE: Now I changed the hole program in the way, that I don't move the Informations around from function to function. I use a global configuration hash now. That made things much easier, and now the grid toggle works even during the game. You can now (in version 0.0.4) toggle the grid with the key F3 all the time.

I am sorry, but I can not upload the script now, but perhaps it fits in the window, because the code is a good piece smaller by this changes. If not, it will be available this evening (I will update the first post then.)

UPDATE: Now I uploaded the program in Version 0.0.4, have fun :-)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://385402]
help
Chatterbox?
[ambrus]: Corion: ah, so you want a library that parses HTTP, and you want to do the IO yourself, and don't want a full AnyEvent wrapper.
[ambrus]: Corion: I think I parsed a HTTP header from a string with LWP once. You can definitely use that to create a HTTP message too. The problme is
[ambrus]: that if you do that, you'd have to find where each HTTP response ends, which is nontrivial if you want persistent connections (essential for performance if you have small requests).
[Corion]: ambrus: Yes, ideally an API that I feed the incoming data piece by piece and that I can ask "is that response done" and "what should I do next" and "please construct the appropriate redirect for me"
[Corion]: ambrus: Yes, ideally the module would do all that nasty stuff for me and give me a way to ask it what the current situation is
[ambrus]: Corion: you could also consider using some wrapper over the multi interface of curl, I think Net::Curl might be a good one, since implementing enough of what it expects from the event loop might be easier than a full AnyEvent interface.

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (16)
As of 2016-12-07 16:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (130 votes). Check out past polls.