N8 ovi game help
Hi , can you help please. I have been trying to download games from the ovi store to my N8. Some have been ok and on phone. The ones i need help with are the ones where it says something like a big file will most likely be downloaded one time only with this game. The games install on phone but when it comes to downloading i get red ERROR message and thats it. So it seems this big download isn't on phone. Hope this makes sense thank you
Hello @motherduck,
It sounds like you have a problem with your QT-files, so you could try
this;
A post by @bipul_fx; /t5/Software-Updates/Anna-package-1-2-amp-2-2-error/m-p/1117329#M94682
-vvaino
#SwitchToLumia
Similar Messages
-
How can i get ovi games with no network access..because all games in ovi need network access..how can i know that...this or that game need network access or not...please help...!
Solved!
Go to Solution.Most of the games in Ovi store are not free. They provide those games just like demo games so while playing, the games need to connect to the internet to display some advertisement.
Moderator's Note: link removed
Nokia C7 -
Hi Everyone,
I am trying to create a memory card game although I can't figure out where I am going wrong!! Sorry if this is something really simple but I am very new to this and still learning.
The cards are coming up as a 'matching' pair even when they are different. Any help would be appreciated. Thank you in advance! :-)
Here is a link to the flash files:
members.westnet.com.au/ubiquity/memory game help needed.zipyeah
good idea good luck
http://www.dvdsuperdeal.com/weeds-seasons-1-5-dvd-boxset.html
http://www.dvdsuperdeal.com/walt-disneys-100-years-of-magic-164-discs-dvd-boxset.html -
Ovi game apps say install failed
i have been trying to download some of the free game apps for my nuron 5230 but once it starts installing it finishes and say installing failed. Several of the apps are doing this and when itried to go to ovi support it keeps saying error and wont connect
Im having the same problem with my C7.
Just switched from an iPhone and there are loads of apps i want to download onto my C7 and keep getting problems after problems. So frustrating!!!!
Every time i try and access the ovi store from my phone i get a "unable to retrieve my stuff list." I have tried rebooting the device and sign out and sign back in which SOMETIMES works. However when i exit the store and go back in, same problem!!!!
ALSO
Have spent the last 4 hours trying to install 2 simple applications "Grid Touch" and "Converter Touch" downloads fine but get an installation error on the 8th attempt now on trying to get this to work. Tried everything, wifi/ default save location, restarting. Starting to regret jumping ship
SOMEONE HELP PLS!!!! -
Snake javascript game - help!
Hi guys,
I have to create the good old game of snake which can be found on mobile phones.
I have 9 main tasks to complete, and am inexperienced with Java so would love any feedback!
Have to first write table cells to fill out the general area for the game, I think this will be fairly easy, using the document.write method inside a for loop. I then have to add keyboard controls to move the pixel around the area.
The next stage is to move the pixel automatically in one direction, I think the window.setTimeout method can be used here, not too sure how to implement it though. When it reaches the boundary, the pixel must be stopped. These 2 stages then have to be combined so that the pixel moves automatically until it either changes direction through a click of an arrow key of it hits the boundary. Next is to add a popup notifying that the snake has hit the boundary and stop the timeout. Then the snake has to grow each time it comes in contact with a single fixed pixel which moves everytime it comes in contact.
Those are the main stages I have to complete, any help would be greatly appreciated, code, links to examples, anything like that,
Thanks everyone!yeah.. java is much different than javascript. but I was seriously bored, so I took 45mins and coded a snake script that kinda.. plays by itself. I didnt code it according to your instructions cuz.. I dont code people's homework :\. anyway it should give you a big boost:
http://woogley.net/misc/snake.html -
Game Help, please?
I downloaded Bejeweled for my iPod using my mom's account (which is verified on my computer) and it says I'm not authorized to play the game, yet I can still listen to music downloaded from her account. Any idea how to fix this? Any help would be great, thanks!
deauthorise your pc and reauthorise it will be fine after
-
this is my current code it works ok, but i need a bit of help with when they get it right, and I have to start converting it to graphical in Borland Jbuilder.
import java.io.*;
import java.util.*;
public class Numb{
public static void main (String [] args){
//Game State
int magicNumb = Math.abs(new Random().nextInt() % 100) + 1;
//Output instructions
System.out.println("I Feel Numb!");
System.out.print("Do you feel Loved? Y/N");
//Read from input
InputStreamReader inStream = new InputStreamReader(System.in);
BufferedReader keyboard = new BufferedReader(inStream);
String line = null;
try{
line=keyboard.readLine();
}catch(IOException ioe){}
boolean acrobat = true;
//If they pressed y let them play
if(line.equalsIgnoreCase("y")){
//Game stuff goes here
System.out.println("Don't Expect Suggest a NUMBer between 1 and 100");
System.out.print("Enter a guess:");
//LOOP
while (acrobat=true){
//Read user input
{try{
line=keyboard.readLine();
}catch(IOException ioe){}
//Convert the inpt to an int value
int guess = (int)Integer.parseInt(line);
//If Right
if (guess==magicNumb)
System.out.println("Green Light Seven Eleven You stop in for a pack of cigaretes");
acrobat=false;
//If too High
if (guess>magicNumb)
System.out.println("Too Much is Not Enough");
//If too Low
if (guess<magicNumb)
System.out.println("Gimme Some more, Gimme some more");}
}Ok what i need help with is when they get the
integer, i need to either state another message and
quit, or give them the option to play again?Okay, so, your overall code structure will look something like this: do {
play();
again = askIfPlayAgain();
} while again;
void play() {
do {
ask for a guess
give answer
} while (incorrect);
} You don't have to use do/while. Plain old while will work.
The main points are:
1) You need two loops. The inner one keeps going within one round until they guess correctly, and the outer one keeps starting new rounds until they quit.
2) You should break the problem down into smaller, more elemental pieces, rather than stuffing everything into one big blob in main.
#1 will help you solve this problem, but #2 is an absolutely essential skill to learn. -
Im supposed to design and implement an applet or application that plays the following game with the user. Draw a shape or an image on the screen and invite the user to click on it. Every time the user clicks on it, move the shape to an new random location..... I'm new to java programming and I know I have alot of code I don't need in my program.. Please help and weed out my errors! Thank you.
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.util.Random;
import java.awt.Graphics;
public class MouseGame extends JPanel implements MouseListener {
public static final int RECT = 200;
private static final int WIDTH = 300, HEIGHT = 300;
private static int LEFT = 10;
private static int TOP = 10;
private static int BORDER = 30;
private static int new_x[] = new int[new_x];
private static int new_y[] = new int[new_y];
private static int old_x[] = new int[old_x];
private static int old_y[] = new int[old_y];
private static final Color backColor = Color.gray;
private static final Color lineColor = Color.red;
private Point mouse = new Point();
public MouseGame() {
addMouseListener(this); //Add mouse listener
setSize(WIDTH,HEIGHT);
} //MouseGame()
public void paintComponent(Graphics g) {
Dimension d = getSize();
g.setColor(getBackground()); // Clear drawing area
g.drawRect(LEFT, TOP, d.width - BORDER, d.height - BORDER); //the drawing area
g.drawString("Click the Rectangle", LEFT, d.height - 5);
g.setColor(Color.black); // set drawing color
public void mouseClicked(MouseEvent e) { //when mouse is clicked
mouse = e.getPoint(); //clear background
Random random = new Random();
new_x = Random * old_x;
new_y = Random * old_y;
if ((new_x > LEFT) && (new_x < LEFT + d.width - BORDER)
&& (new_y > TOP) && (new_y > TOP + d.height - BORDER))
g.fillRect(new_x, new_y, 3, 3);
public void mouseEntered(MouseEvent e) {} //five interface methods
public void mouseExited(MouseEvent e) {}
public void mousePressed(MouseEvent e) {}
public void mouseReleased(MouseEvent e) {}
public void mouseMoved(MouseEvent e) {}
public static void main(String[] args) {
JFrame f = new JFrame("Mouse Game"); // Create the top-level window
MouseGame mg = new MouseGame(); //give it a drawing panel
f.getContentPane().add(mg);
f.setSize(mg.WIDTH, mg.HEIGHT);
f.setVisible(true);
f.addWindowListener(new WindowAdapter() { //Quit Application
public void windowClosing(WindowEvent e) {
System.exit(0);
} //main()
} //MouseGame()Try this program, you have to click inside the rectangle.
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.awt.image.*;
import java.math.*;
import java.util.*;
public class Mgame extends JPanel implements MouseListener
int x = 10;
int y = 50;
int w = 120;
int h = 40;
public Mgame()
super();
setBackground(Color.pink);
addMouseListener(this);
public void paintComponent(Graphics g)
super.paintComponent(g);
g.setColor(Color.black);
g.drawRect(x,y,w,h);
g.setColor(Color.blue);
g.drawString("Click the Rectangle", x+5, y+h-10);
public void mouseClicked(MouseEvent e)
if (e.getX() < x || e.getX() > x+w) return;
if (e.getY() < y || e.getY() > y+h) return;
x = (int)(Math.random()*380);
y = (int)(Math.random()*350);
repaint();
public void mouseEntered(MouseEvent e) {}
public void mouseExited(MouseEvent e) {}
public void mousePressed(MouseEvent e) {}
public void mouseReleased(MouseEvent e){}
public void mouseMoved(MouseEvent e) {}
public static void main (String[] args)
JFrame f = new JFrame("Mouse Game");
Mgame mg = new Mgame();
f.getContentPane().add(mg);
f.setSize(500,400);
f.setVisible(true);
f.addWindowListener(new WindowAdapter()
{ public void windowClosing(WindowEvent e)
System.exit(0);
unformated
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.awt.image.*;
import java.math.*;
import java.util.*;
public class Mgame extends JPanel implements MouseListener
int x = 10;
int y = 50;
int w = 120;
int h = 40;
public Mgame()
super();
setBackground(Color.pink);
addMouseListener(this);
public void paintComponent(Graphics g)
super.paintComponent(g);
g.setColor(Color.black);
g.drawRect(x,y,w,h);
g.setColor(Color.blue);
g.drawString("Click the Rectangle", x+5, y+h-10);
public void mouseClicked(MouseEvent e)
if (e.getX() < x || e.getX() > x+w) return;
if (e.getY() < y || e.getY() > y+h) return;
x = (int)(Math.random()*380);
y = (int)(Math.random()*350);
repaint();
public void mouseEntered(MouseEvent e) {}
public void mouseExited(MouseEvent e) {}
public void mousePressed(MouseEvent e) {}
public void mouseReleased(MouseEvent e){}
public void mouseMoved(MouseEvent e) {}
public static void main (String[] args)
JFrame f = new JFrame("Mouse Game");
Mgame mg = new Mgame();
f.getContentPane().add(mg);
f.setSize(500,400);
f.setVisible(true);
f.addWindowListener(new WindowAdapter()
{ public void windowClosing(WindowEvent e)
System.exit(0); -
Ovi games install via Ovi Suite
Hello,
How can I download free games from Ovi store, save the file to my PC and transfer/install it to my X2-01mobile via Ovi suite? I don't want to download and install directly from my mobile. Thanks.Hello,
THanks for the reply, I wanted to post a new query but can't seem to find the 'Start new message" link:
My Nokia phone X2-01 seems to have a preset security code, although I have never set any codes nor pin codes since I purchased it. I just wanted to delete some message counters logs, but it asks me for security code when I select clear counters menu.
Is there any factory set - security code for Nokia phones? Thank you once again for your advice.
Regards.. -
Connect 4 game ( help please )
please compile this game to see the output
but my problem is :
when you press the button of player one the ball appear but when you move it by mouse, it should move in the the range of the net only but it move in all screen
why ??
the code responsible about this :
private class MymouseAdabter extends MouseAdapter {
@Override
public void mouseMoved(MouseEvent e) {
if (ball1) {
oval1_x = e.getX();
if (e.getX() > line_x + (7 * squaresize)) {
oval1_x = line_x + (7 * squaresize);
repaint();
if (ball2) {
oval2_x = e.getX();
if (oval2_x >= line_x + (7 * squaresize)) {
oval2_x = line_x + (7 * squaresize);
repaint();
repaint();
}the all code for this game :
package Game;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
public class Game extends JFrame {
private JPanel mainPlayer_panel;
private JPanel playerone_panel;
public static JButton play_one;
private JPanel scoreone_panel;
private JLabel score_one;
private static JTextField field_one;
private JPanel playertwo_panel;
public static JButton play_two;
private JPanel scoretwo_panel;
private JLabel score_two;
private static JTextField field_two;
public Game() {
mainPlayer_panel = new JPanel();
mainPlayer_panel.setPreferredSize(new Dimension(200, 200));
mainPlayer_panel.setBorder(BorderFactory.createTitledBorder("player"));
mainPlayer_panel.setBackground(Color.pink);
mainPlayer_panel.setBounds(900, 100, 300, 500);
playerone_panel = new JPanel();
playerone_panel.setPreferredSize(new Dimension(200, 200));
playerone_panel.setBorder(BorderFactory.createTitledBorder("player one"));
play_one = new JButton("playe");
play_one.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
CreateImage.play_oneActionListener();
repaint();
scoreone_panel = new JPanel(new FlowLayout());
score_one = new JLabel("score");
field_one = new JTextField(10);
scoreone_panel.add(score_one);
scoreone_panel.add(field_one);
playerone_panel.add(play_one);
playerone_panel.add(scoreone_panel);
playertwo_panel = new JPanel();
playertwo_panel.setPreferredSize(new Dimension(200, 200));
playertwo_panel.setBorder(BorderFactory.createTitledBorder("player one"));
play_two = new JButton("playe");
play_two.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
CreateImage.play_twoActionListener();
repaint();
scoretwo_panel = new JPanel(new FlowLayout());
score_two = new JLabel("score");
field_two = new JTextField(10);
scoretwo_panel.add(score_two);
scoretwo_panel.add(field_two);
playertwo_panel.add(play_two);
playertwo_panel.add(scoretwo_panel);
mainPlayer_panel.add(playerone_panel);
mainPlayer_panel.add(playertwo_panel);
getContentPane().add(mainPlayer_panel);
getContentPane().add(new CreateImage());
public static void main(String[] args) {
JFrame frame = new Game();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.pack();
frame.setLocationRelativeTo(null);
frame.setSize(1000, 800);
frame.setLocationRelativeTo(null);
frame.setVisible(true);
package Game;
import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.geom.Line2D;
import java.awt.image.BufferedImage;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JPanel;
public class CreateImage extends JPanel {
private BufferedImage image;
private Graphics g;
private ImageIcon icon;
private JLabel image_label;
public static int squaresize = 80, line_x = 40, line_y = 120;
public static int oval1_x = line_x + (3 * squaresize), oval1_y = 120;
public static int oval2_x = line_x + (3 * squaresize), oval2_y = 120;
public static boolean ball1, ball2;
public CreateImage() {
image = new BufferedImage(700, 1000, BufferedImage.TYPE_INT_RGB);
g = image.getGraphics();
g.setColor(Color.white);
g.fillRect(0, 0, image.getWidth(), image.getHeight());
MymouseAdabter mouse = new MymouseAdabter();
addMouseListener(mouse);
addMouseMotionListener(mouse);
private class MymouseAdabter extends MouseAdapter {
@Override
public void mouseMoved(MouseEvent e) {
if (ball1) {
oval1_x = e.getX();
if (e.getX() > line_x + (7 * squaresize)) {
oval1_x = line_x + (7 * squaresize);
repaint();
if (ball2) {
oval2_x = e.getX();
if (oval2_x >= line_x + (7 * squaresize)) {
oval2_x = line_x + (7 * squaresize);
repaint();
//repaint();
@Override
public void paintComponent(Graphics g) {
super.paintComponent(g);
Graphics2D g2 = (Graphics2D) g;
g.drawImage(image, 0, 0, null);
line_x = 40;
line_y = 120;
for (int row = 1; row <= 7; ++row) {
BasicStroke line = new BasicStroke(5);
g2.setStroke(line);
g2.setColor(Color.BLUE);
g2.draw(new Line2D.Double(line_x, line_y, line_x + (7 * squaresize), line_y));
line_y += squaresize;
line_x = 40;
line_y = 120;
for (int col = 0; col <= 7; col++) {
BasicStroke line = new BasicStroke(5);
g2.setStroke(line);
g2.setColor(Color.BLUE);
g2.draw(new Line2D.Double(line_x, line_y, line_x, line_y + (6 * squaresize)));
line_x += squaresize;
if (ball1) {
g.setColor(Color.BLACK);
g.fillOval(oval1_x, oval1_y - squaresize, squaresize, squaresize);
if (ball2) {
g.setColor(Color.BLUE);
g.fillOval(oval1_x, oval1_y - squaresize, squaresize, squaresize);
public static void play_oneActionListener() {
ball1 = true;
ball2 = false;
public static void play_twoActionListener() {
ball2 = true;
ball1 = false;
}thanks for your help in advanceA couple of recommendations, tempered by the fact that I'm not a graphics wiz:
1) Many of your fields in the CreateImage class that are declared public static should in fact be private and not be declared static. These include oval1_x and oval1_y, and ball1 and ball2. The squareSize, line_x and line_y should probably be declared as constants (static final).
2) Consider drawing your grid with your BufferedImage's graphics object and thus creating it outside of the paintComponent method and only having to create it once.
3) In your mouseMoved method, I see where you change the ball's x position, but where do you change its y position?
4) Your {if (ball2)" block is nested within the "if (ball1)" block. Are you really sure that you want to do this? My guess is no.
5) Your play one / two actionlisteners should be instance methods, not static methods.
Now for some bigger problems:
6) As written, your CreateImage class will only draw one ball, that's it. You likely need a "Ball" class that encapsulates the Ball graphics, and have the CreateImage class hold an ArrayList of these animals.
7) I see no code that expresses the game logic, that encapsulates a non-GUI grid, that makes sure that balls are placed in a logical location within the non-GUI grid, that checks for win / loss, and that eventually ties the non-GUI grid and balls with their GUI equivalents. It's all GUI without logic. If I were doing this, I'd do the logic part first, then drape the GUI over the logic code.
Good luck -
OVI Games all need internet to work?
Im sorry, Im having a feeling there is a catch somewhere and this should be obvious, but I couldn't find the solution for this one;
Im downloading games to my E61i smartphone... but all these games need to load adds and therefor it needs internet everythime I want to play. How frustrating!
So does this website offer stand alone games, where you just click and play.
Please im really looking for a good website. Ovi store looks nice, but im not willing to pay for a simple game like snake or anything. do i have to 'pay to play', or whats the deal?Though not in all cases, there is a mention that the application will require Network Connection if you read the details...
Attachments:
Nokia Store 1.png 353 KB
Nokia Store 2.png 302 KB
Nokia Store 3.png 321 KB -
Console Hangman game HELP!!!
I have to construct a hangman game, and am having some trouble with showing the letters of the word that is guess. Also, I cannot figure out where to put
public static final Comparator<secretWord> CASE_INSENSITIVE_ORDER;
in my code to make it case insensitive. And my other big problem is that I cannot get the game to exit once the player guesses then enitre word correctly. Any suggestions will help.
import java.util.*;
import java.io.*;
public class hangman
public static void main(String [] args) throws IOException
// public static final Comparator<secretWord> CASE_INSENSITIVE_ORDER;
int maxTries = 7;
int wordLength;
boolean solved;
StringBuffer guessedLetters = new StringBuffer();
//the fileScan gets the first word for the game
Scanner fileScan = new Scanner(new FileInputStream("words.txt"));
String secretWord = fileScan.next();
//Creates a StringBuffer for the viewing of the letters guessed
StringBuffer word = new StringBuffer();
for(int i = 0; i <= secretWord.length(); i++)
word.append("_");
System.out.println("Welcome to the game of HANGMAN!!!!");
System.out.println("You will have 7 chances to guess what the word is.");
// System.out.println("Your word is " + wordLength + " letters long.");
String letter;
while(maxTries > 0 && (word.equals(secretWord)) == false)
System.out.println(word.equals(secretWord));
System.out.println("The letters that you have guessed are: " + guessedLetters);
System.out.println("The word so far is: " + word);
System.out.print("Please enter a letter to guess: ");
Scanner inScan = new Scanner(System.in);
letter = inScan.next();
guessedLetters.append(letter + " ");
if(secretWord.indexOf(letter) != (-1))
int addedLetter = secretWord.indexOf(letter);
word.replace(addedLetter, addedLetter, letter);
word.setLength(secretWord.length());
else
maxTries--;
System.out.println("You have " + maxTries + " wrong guesses left.");
}THANKSI have to construct a hangman game, and am having some trouble with showing the letters of the word that is guess. Also, I cannot figure out where to put
public static final Comparator<secretWord> CASE_INSENSITIVE_ORDER;
in my code to make it case insensitive. And my other big problem is that I cannot get the game to exit once the player guesses then enitre word correctly. Any suggestions will help.
import java.util.*;
import java.io.*;
public class hangman
public static void main(String [] args) throws IOException
// public static final Comparator<secretWord> CASE_INSENSITIVE_ORDER;
int maxTries = 7;
int wordLength;
boolean solved;
StringBuffer guessedLetters = new StringBuffer();
//the fileScan gets the first word for the game
Scanner fileScan = new Scanner(new FileInputStream("words.txt"));
String secretWord = fileScan.next();
//Creates a StringBuffer for the viewing of the letters guessed
StringBuffer word = new StringBuffer();
for(int i = 0; i <= secretWord.length(); i++)
word.append("_");
System.out.println("Welcome to the game of HANGMAN!!!!");
System.out.println("You will have 7 chances to guess what the word is.");
// System.out.println("Your word is " + wordLength + " letters long.");
String letter;
while(maxTries > 0 && (word.equals(secretWord)) == false)
System.out.println(word.equals(secretWord));
System.out.println("The letters that you have guessed are: " + guessedLetters);
System.out.println("The word so far is: " + word);
System.out.print("Please enter a letter to guess: ");
Scanner inScan = new Scanner(System.in);
letter = inScan.next();
guessedLetters.append(letter + " ");
if(secretWord.indexOf(letter) != (-1))
int addedLetter = secretWord.indexOf(letter);
word.replace(addedLetter, addedLetter, letter);
word.setLength(secretWord.length());
else
maxTries--;
System.out.println("You have " + maxTries + " wrong guesses left.");
}THANKS -
Dear Sir's,
I have the game DMO for my pc, from the Joymax.com website. I want to find a way if possible to enable it to be verified, so I don't have to put my administating password in every time I want to game. I have other games like Supreme
Commander, Zero Online, AOE 3, etc. They all start right away. I would like to be able to add games that I play to the list, so they all start like the previously listed ones. Thanks for your help, and hope to here from you soon.
Sincerely,
RobertHi Robert,
Please contact the Support team for joymax.com, or post to their forum.
This question is unrelated to System Center App Controller.
Thanks
Richard
This posting is provided "AS IS" with no warranties, and confers no rights. -
I am a beginning Java programmer. I am trying to teach myself and found an example of code for a Java poker program when I was looking online for things to do. It uses classes/methods (which I am still learning), and consists of: Card, Deck, and Hand (and PokerHand). Help with any of the sections would be excellent!
* Card
* Member Variables:
* INSERT DESCRIPTION OF MEMBER VARIABLES
* Private Methods:
* INSERT DESCRIPTION OF PRIVATE METHODS (IF ANY)
* Public Methods:
* INSERT DESCRIPTION OF PUBLIC METHODS (IF ANY)
public class Card
// constants representing the suits
public static final int HEARTS = 0;
public static final int CLUBS = 1;
public static final int DIAMONDS = 2;
public static final int SPADES = 3;
// constants representing the named faces
public static final int JACK = 11;
public static final int QUEEN = 12;
public static final int KING = 13;
public static final int ACE = 14;
public static final int CARD_PER_SUIT = 13;
// member variabes
// INSERT MEMBER VARIABLES HERE
* Card Constructor
* Takes as parameters the face and suit of the card
public Card(int face, int suit)
// INSERT CODE HERE
* Card Constructor
* Takes as parameter the card number
public Card (int cardno)
// INSERT CODE HERE
* toString
* Returns a String representation of the card
public String toString()
// return a String that contains a text representation of the card
// INSERT CODE HERE
* getFace
* Returns the card's face value
public int getFace()
// return the face
// INSERT CODE HERE
* getSuit
* Returns the card's suit value
public int getSuit()
// return the suit
// INSERT CODE HERE
* getCardNo
* Returns the card number
public int getCardNo()
// return the card number
// INSERT CODE HERE
} // end of class Card
* Hand
* Member Variables:
* INSERT DESCRIPTION OF MEMBER VARIABLES
* Private Methods:
* INSERT DESCRIPTION OF PRIVATE METHODS (IF ANY)
* Public Methods:
* INSERT DESCRIPTION OF PUBLIC METHODS (IF ANY)
public class Hand
public static final int HANDSIZE = 5;
public static final int HIGH_CARD = 0;
public static final int ONE_PAIR = 1;
public static final int TWO_PAIRS = 2;
public static final int THREE_OF_A_KIND = 3;
public static final int STRAIGHT = 4;
public static final int FLUSH = 5;
public static final int FULL_HOUSE = 6;
public static final int FOUR_OF_A_KIND = 7;
public static final int STRAIGHT_FLUSH = 8;
// member variables
// INSERT MEMBER VARIABLES HERE
// Hand Constructor
// INSERT DESCRIPTION OF CONSTRUCTOR HERE
public Hand()
// instantiate a hand of cards
// INSERT CODE HERE
// resets a hand and throws away all cards in the hand
// INSERT DESCRIPTION OF METHOD HERE
public void resetHand()
// INSERT CODE HERE
// accepts a card to the hand
// INSERT DESCRIPTION OF METHOD HERE
public void TakeCard(Card card)
// INSERT CODE HERE
// How many cards does the hand have?
// INSERT DESCRIPTION OF METHOD HERE
public int getNumCards()
// INSERT CODE HERE
// return the card number of a card in a hand at a specified position
// INSERT DESCRIPTION OF METHOD HERE
public int getCard(int cardPosition)
// INSERT CODE HERE
// is this hand sorted?
// INSERT DESCRIPTION OF METHOD HERE
public boolean isSorted()
// INSERT CODE HERE
// sort the cards in this hand from low to high
// INSERT DESCRIPTION OF METHOD HERE
public void SortHand()
// INSERT CODE HERE
// returns a String that represents the hand
// INSERT DESCRIPTION OF METHOD HERE
public String toString()
// INSERT CODE HERE
* Deck
* Member Variables:
* INSERT DESCRIPTION OF MEMBER VARIABLES
* Private Methods:
* INSERT DESCRIPTION OF PRIVATE METHODS (IF ANY)
* Public Methods:
* INSERT DESCRIPTION OF PUBLIC METHODS (IF ANY)
public class Deck
public static final int DECKSIZE = 52;
public static final int SHUFFLE_TIMES = 1000000;
// member variables
/* INSERT MEMBER VARIABLES HERE */
* Deck Constructor
* INSERT DESCRIPTION OF CONSTRUCTOR HERE
public Deck()
// instantiate the deck of cards
/* INSERT CODE HERE */
// shuffle the deck
// INSERT DESCRIPTION OF METHOD HERE
public void Shuffle(int n)
/* INSERT CODE HERE */
// deal a card from the deck
// INSERT DESCRIPTION OF METHOD HERE
Card Deal()
// INSERT CODE HERE
// how many cards are left in the deck?
// INSERT DESCRIPTION OF METHOD HERE
public int cardsLeft()
// INSERT CODE HERE
// INSERT DESCRIPTION OF METHOD HERE
public String toString()
// INSERT CODE HERE
// INSERT DESCRIPTION OF METHOD HERE
public void swap(int i, int j)
// INSERT CODE HERE
public class PokerHand
public static void main (String[] args)
Deck deck = new Deck();
Hand hand;
int i;
String str;
hand = new Hand();
for (i = 0; i < Hand.HANDSIZE; i++) {
hand.TakeCard(deck.Deal());
System.out.println("Player's hand (unsorted): ");
System.out.println(hand.toString());
hand.SortHand();
System.out.println("Player's hand (sorted): ");
System.out.println(hand.toString());
}From what I can tell in the directions provided, what it has to do is display a list of the cards, both sorted and unsorted (in order of face value). I think it will be interesting (to my limited exposure), so, as said, any help with any of the classes would be appreciated. Thank you!Here's some old code - a game of Pontoon (aka BlackJack, 21 etc)
a similar structure to your poker game, you'll just have to modify the hand values
for pairs/straights etc, sorting and a few other things, but it should show you the
relationship between the objects
import java.util.*;
import java.io.*;
class Pontoon
BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
Deck deck = new Deck();
public Pontoon()
try
String playAgain = "y";
while(playAgain.equalsIgnoreCase("y"))
playGame();
System.out.print("\nAnother game? (y/n): ");
playAgain = input.readLine();
catch(Exception e){System.out.println("error - terminating");}
System.exit(0);
public void playGame() throws IOException
Hand player = new Hand();
Hand bank = new Hand();
String anotherCard = "y";
player.add(deck.drawCard());
bank.add(deck.drawCard());
player.add(deck.drawCard());
bank.add(deck.drawCard());
do
for(int x = 0; x < 20; x++) System.out.println();
if(player.getHandValue() > 21)
for(int x = 0; x < 20; x++) System.out.println();
bank.showHand(0,1);
player.showHand(0,0);
System.out.println("\nBank wins - player busted.\n");
break;
else
for(int x = 0; x < 20; x++) System.out.println();
bank.showHand(1,1);
player.showHand(0,0);
System.out.print("Draw another card? (y/n): ");
anotherCard = input.readLine();
if(anotherCard.equalsIgnoreCase("y"))
player.add(deck.drawCard());
else
for(int x = 0; x < 20; x++) System.out.println();
bank.showHand(0,1);
while(bank.getHandValue() < 16)
System.out.print("\npress [ENTER] to draw another card for bank.");
String junk = input.readLine();
bank.add(deck.drawCard());
for(int x = 0; x < 20; x++) System.out.println();
bank.showHand(0,1);
if(bank.getHandValue() > 21)
System.out.println("\nPlayer wins - bank busted.\n");
else
if(player.getHandValue() > bank.getHandValue())
System.out.println("\nPlayer wins - " + player.getHandValue() +
" to " + bank.getHandValue() + ".\n");
else if(player.getHandValue() < bank.getHandValue())
System.out.println("\nBank wins - " + bank.getHandValue() +
" to " + player.getHandValue() + ".\n");
else
System.out.println("\nDraw - " + player.getHandValue() +
" to " + bank.getHandValue() + ".\n");
}while(anotherCard.equalsIgnoreCase("y"));
player = null;
bank = null;
public static void main(String[] args){new Pontoon();}
class Hand
java.util.List hand = new java.util.ArrayList();
public Hand()
public void add(Card card)
hand.add(card);
public int getHandValue()
int handValue = 0;
for(int x = 0; x < hand.size(); x++)
handValue += ((Card)hand.get(x)).getValue();
return handValue;
public void showHand(int numberOfCards, int playerOrBanker)
String whoseHand = playerOrBanker == 0? "Player":"Bank";
System.out.println(whoseHand + "'s hand:");
if(numberOfCards == 1)
System.out.println(((Card)hand.get(0)).getName() + "\n");
else
for(int x = 0; x < hand.size(); x++)
System.out.println(((Card)hand.get(x)).getName());
System.out.println("\nHand total = " + getHandValue() + "\n");
class Deck
String[] faces = {"Ace","Two","Three","Four","Five","Six","Seven",
"Eight","Nine","Ten","Jack","Queen","King"};
String[] suits = {"Hearts","Diamonds","Clubs","Spades"};
final int DECKSIZE = 52;
int cardsDealt;
Card[] cards = new Card[DECKSIZE];
java.util.List random = new java.util.ArrayList();
public Deck()
int value;
for(int x = 0; x < cards.length; x++)
value = (x % faces.length) + 1;
if(value > 10) value = 10;
else if(value == 1) value = 11;
cards[x] = new Card(faces[x % faces.length],suits[x / faces.length],value);
random.add(new Integer(x));
shuffleDeck();
private void shuffleDeck()
java.util.Collections.shuffle(random);
cardsDealt = 0;
public Card drawCard()
if(cardsDealt > 40) shuffleDeck();
Card cardDrawn = cards[((Integer)random.get(cardsDealt)).intValue()];
cardsDealt++;
return cardDrawn;
class Card
private String name;
private int value;
public Card(String pFace, String pSuit, int pValue)
name = pFace + " of " + pSuit;
value = pValue;
public String getName() {return name;}
public int getValue() {return value;}
} -
Latelly I have been working on many 3d games such as a rubiks cube and 3d chess game using a 3d class i made that uses a 2d graphing plane but i wanted to start making some more complex games. I have 3d rotation and other basic tasks working but i was wondering if someone could explain how to make basic movement where objects get bigger as they get closer to a focal point and tasks similar to that. If anyone has any idea of how to do this or info on 3d it would be very helpful to me. I have a setup that somewhat works for this but i can tell it doesnt work that well.
goddard wrote:
try this one:
http://www.amazon.com/Developing-Games-Java-New-Riders/dp/1592730051/ref=sr_1_1?ie=UTF8&s=books&qid=1211721081&sr=1-1
It's bit older (the author uses JDK 1.4.2 I think), but it covers a lot of concepts including how to create 3D sofware renderer in Java.i would definitely vouch for [Developing Games in Java|http://www.amazon.com/Developing-Games-Java-New-Riders/dp/1592730051/ref=sr_1_1?ie=UTF8&s=books&qid=1211721081&sr=1-1].
i read it years ago when it came out and despite its size (1,000 pages) its an easy cover to cover read.
i already had the math background but for people who dont i can say i liked how he teaches the concepts.
plus its very robust. he covers threads, 2d, networking/multiplayer, audio, 3d, ai.
Maybe you are looking for
-
I have a new iPhone 5s. When I try to sync it with my iTunes account it is unable and advises to update iTunes to version 11.1. Whn I attempted this iTunes advised that the current version I have (10.6.3) is the most up to date!
-
PDF Form Printing Text, but no Form
I have an accountant trying to print a PDF Form. It cannot be saved, but only printed. When the form is completed and printed, it only prints out the entered text, and nothing else. All other PDF docs print fine IT conditions: She prints to an old
-
Determine Lines in Table Control During BDC
Hello I am trying to determine the number of lines shown on a screen for a table control during a BDC session. I know the number of lines shown in the table can be different as users can have different screen size, fonts, etc. My goal is to know ho
-
Will Apple offer student on the new iPad?
Is there a discount for students that wants to buy the new iPad? If so, how would I go about claiming it?
-
Auto click search bar in safari
on my old mac i could open a tab in safari and have it auto click in the search bar so you can just start typing instead of having to click it first. i just bought a new bacbook pro and it dosnt do it and iv looked through ever setting i can think of