[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: Feedback messages to user using Tk...

Cameron, Gemma (UK)

9/28/2006 9:16:00 AM


Thanks again Morton!

The code was written off the top of my head into the email (which would explain the syntax errors, honest!) but the conceptual error is probably where I was having the problem. I'm still a ruby nuby and my coding ability is somewhat immature... As such any help and criticism is welcomed and vastly appreciated!!! How else am I to learn?!

I also followed the Tk "Stopwatch" recipe in the O'Reilly Ruby cookbook and came across the timer before, however they used TkAfter instead of TkTimer.

Thanks again for all your help - I will keep you all posted on the progress (if you're interested of course)

Thanks

Gem

-----Original Message-----
From: Morton Goldberg [mailto:m_goldberg@ameritech.net]
Sent: 27 September 2006 18:18
To: ruby-talk ML
Subject: Re: Feedback messages to user using Tk...

There are quite a few errors in that code. Even if you fixed its
syntax, you'd have a conceptual error. You'd only see the last
message: "I'm done". The initial message would be replaced by the
first update call and the second message would then be replaced by
the second update call before the window got on the screen. But
you're moving in the right direction.

You need something to delay the updates until the window gets
displayed. A timer is one way to do it.

<code>
#! /usr/bin/ruby -w

require 'tk'

class GraphicalProgress
def initialize
root = TkRoot.new { title 'Progress' }
@my_label = TkLabel.new(root) {
text 'Waiting for something to report...'
}
@my_label.pack(:pady=>20)
# Set initial window geometry; i.e., size and placement.
win_w, win_h = 300, 80
# root.minsize(win_w, win_h)
win_x = (root.winfo_screenwidth - win_w) / 2
root.geometry("#{win_w}x#{win_h}+#{win_x}+50")
root.resizable(false, false)
end

def update(message)
@my_label.text = message
end
end

msgs = ["I'm doing something", "I'm done"]
indx = 0
progress = GraphicalProgress.new
timer = TkTimer.start(1000, 2) do
progress.update(msgs[indx])
indx += 1
end

Tk.mainloop
</code>

Regards, Morton





********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************

9 Answers

Morton Goldberg

9/28/2006 3:06:00 PM

0

On Sep 28, 2006, at 5:15 AM, Cameron, Gemma (UK) wrote:

> I also followed the Tk "Stopwatch" recipe in the O'Reilly Ruby
> cookbook and came across the timer before, however they used
> TkAfter instead of TkTimer.

TkTimer and TkAfter are one and the same. TkAfter is an alias of
TkTimer. Use whichever name you think makes your code more readable.

> Thanks again for all your help - I will keep you all posted on the
> progress (if you're interested of course)

Sure, keep us posted. I'm always interested in people's adventures
with Ruby/Tk.

Regards, Morton

metallik

10/12/2010 8:27:00 PM

0

> I haven't checked the settings but I bet they're set pretty easy.  I
> will adjust that for sure.  Beyond that, does the game have a lot of
> staying power in a game room?  I know that unskilled players
> absolutely love it.  But I'm wondering if I'll get bored with the
> modes or is there some random aspects to them that I don't know about?

Finishing modes the right way (killing everything, usually involving
side shots) earns saucer lights and more points. Hitting the center
repeatedly will finish most modes as well but no lights or bonuses.

Finishing the bonus wave multiballs in one attempt (40 items in one
MB) means more Mothership MBs and big points.

Using the extra buttons to work the multiplier up during bonus waves
can mean big points, but it is tough to do with 4 balls banging
around.

Attack Mars has its own strategy and use of the extra buttons - it is
tough to beat the default 300M score for that mode.

Borygard

10/12/2010 8:40:00 PM

0

Excellent pointers. You can get to the wizard mode by not being great and
hitting the center shot constantly. To do it right though you want to get
everything required in each mode to light all the saucer lights. That's a
bit tougher to do.

--
Rob Anthony
Pinball Classics
http://LockW...
Quality Board Work - In Home Service
314-766-4587




"metallik" <larry.scott@dlptech.com> wrote in message
news:403a26f2-2441-48b5-8742-3aa8f8efc0d8@d25g2000yqc.googlegroups.com...
> I haven't checked the settings but I bet they're set pretty easy. I
> will adjust that for sure. Beyond that, does the game have a lot of
> staying power in a game room? I know that unskilled players
> absolutely love it. But I'm wondering if I'll get bored with the
> modes or is there some random aspects to them that I don't know about?
>
>Finishing modes the right way (killing everything, usually involving
>side shots) earns saucer lights and more points. Hitting the center
>repeatedly will finish most modes as well but no lights or bonuses.
>
>Finishing the bonus wave multiballs in one attempt (40 items in one
>MB) means more Mothership MBs and big points.
>
>Using the extra buttons to work the multiplier up during bonus waves
>can mean big points, but it is tough to do with 4 balls banging
>around.
>
>Attack Mars has its own strategy and use of the extra buttons - it is
>tough to beat the default 300M score for that mode.


Rompen

10/15/2010 11:16:00 PM

0

On Oct 12, 3:39 pm, "Borygard" <Boryg...@gmail.com> wrote:
> Excellent pointers.  You can get to the wizard mode by not being great and
> hitting the center shot constantly.  To do it right though you want to get
> everything required in each mode to light all the saucer lights.  That's a
> bit tougher to do.
>
> --
> Rob Anthony
> Pinball Classicshttp://LockW...
> Quality Board Work - In Home Service
> 314-766-4587
>
> "metallik" <larry.sc...@dlptech.com> wrote in message
>
> news:403a26f2-2441-48b5-8742-3aa8f8efc0d8@d25g2000yqc.googlegroups.com...
>
> > I haven't checked the settings but I bet they're set pretty easy. I
> > will adjust that for sure. Beyond that, does the game have a lot of
> > staying power in a game room? I know that unskilled players
> > absolutely love it. But I'm wondering if I'll get bored with the
> > modes or is there some random aspects to them that I don't know about?
>
> >Finishing modes the right way (killing everything, usually involving
> >side shots) earns saucer lights and more points.  Hitting the center
> >repeatedly will finish most modes as well but no lights or bonuses.
>
> >Finishing the bonus wave multiballs in one attempt (40 items in one
> >MB) means more Mothership MBs and big points.
>
> >Using the extra buttons to work the multiplier up during bonus waves
> >can mean big points, but it is tough to do with 4 balls banging
> >around.
>
> >Attack Mars has its own strategy and use of the extra buttons - it is
> >tough to beat the default 300M score for that mode.

Is there any way to remove that center-shot easy way to progress?

Thanks for all the info. Yea, I was really impressed during Wizard
mode having to use the extra buttons to move the targets on the screen
into position. That's so clever! And this was simply the first P2K
game. I can only imagine how much better things would have gotten.
The devs were really on their way to integrating video and pinball in
a successful manner. I sure hope Gene can get Wizard Blocks out. I
am also seeing if there's any way I can help.

Rare Hero

10/15/2010 11:28:00 PM

0

On Oct 15, 4:16 pm, Rompen <rompe...@gmail.com> wrote:
> Thanks for all the info.  Yea, I was really impressed during Wizard
> mode having to use the extra buttons to move the targets on the screen
> into position.  That's so clever!

You can also use the extra buttons to change the stuff the aliens are
stealing at the white house to higher point-value stuff.....and to
change the multiplier shot during the Bonus Stage. ...maybe on a few
other modes, I can't remember off hand.

Greg

nhsno@yahoo.com

10/16/2010 12:42:00 AM

0


> Thanks for all the info.  Yea, I was really impressed during Wizard
> mode having to use the extra buttons to move the targets on the screen
> into position.  That's so clever!  And this was simply the first P2K
> game.  I can only imagine how much better things would have gotten.
> The devs were really on their way to integrating video and pinball in
> a successful manner.  I sure hope Gene can get Wizard Blocks out.  I
> am also seeing if there's any way I can help.

The more I play this the more I'm impressed with what they
accomplished in such a small amount of time with this game. They were
given the same amount of time to produce this new generation pin that
they get to produce a traditional (18 months). Many purists claim
"it's not pinball" but I'm guessing the same could be said about DMD
games compared to EMs. It was merely the next step.

chuck

10/16/2010 12:52:00 AM

0

On Oct 15, 7:16 pm, Rompen <rompe...@gmail.com> wrote:

> Is there any way to remove that center-shot easy way to progress?

You can't just shoot the center to get to wizard mode. You need to get
9 (I think it's nine) saucer lights to get to the wizard mode. In
order to get a saucer light you need to complete a mode flawlessly
(actually complete the main goal.) On occasion random saucer lights
are awarded but it's fairly rare.

Rare Hero

10/16/2010 1:08:00 AM

0

On Oct 15, 5:51 pm, chuck <ch...@clhess.com> wrote:
> You can't just shoot the center to get to wizard mode. You need to get
> 9 (I think it's nine) saucer lights to get to the wizard mode. In
> order to get a saucer light you need to complete a mode flawlessly
> (actually complete the main goal.) On occasion random saucer lights
> are awarded but it's fairly rare.

You can also get saucer lights for achieving certain goals during the
multiballs.

Greg

nhsno@yahoo.com

10/16/2010 2:41:00 PM

0


> You can't just shoot the center to get to wizard mode. You need to get
> 9 (I think it's nine) saucer lights to get to the wizard mode. In
> order to get a saucer light you need to complete a mode flawlessly
> (actually complete the main goal.) On occasion random saucer lights
> are awarded but it's fairly rare.

Correct - you can keep hitting the center targets and move to the next
mode rapidly but if you don't achieve all goals or leave things behind
you don't get a saucer light. Without getting 9 saucer lights you
never see the Wizard mode. I still haven't made it there with my
settings but thats a good thing. Makes me want to keep playing