Help with 'Learning Games

Hey you all, I have done very little Flash design, but have a request from a client to add a bunch of Flash childrens' learning games to their website.  I have enough experience to add the premade ones, but not develop them from scratch of course.
There are several sites out there that offer free games, but they always add their website advertisement to the loading area or other areas of the game.
Does anyone know of a purchasable pack of games for developers that can be inserted into standard site pages relatively easily?   Of course if there is a free pack without ads that would be equally nice 

As noted by chris above the games are not compatible with the ipod nano only the larger ipod video. THe games on th eitunes music store in fact make this warning known jsut below the game description
"...THese games are CANNOT be played in itunes, NOR are they COMPATIBLE with other IPOD MODELS." Nor can they be playyed in itunes.
With the emphasis given of course. I dont believe you can get a refund because the system requirements are clearly noted. On another note the ipod nano is Not able to play ANy video content including podcasts. IF you wish for either of these features youll need the ipod video.
GFF:)

Similar Messages

  • Help with rhythm game

    So i am starting university in late september (to learn 3d character animation) and need to get the grades to get in, sadly we have a flash programming unit in the college course im in now and we didnt get taught anything at all and i mean nothing, we were given printed sheets and told to copy the code word for word. so i really need help with my game. how would i make the movement of something my cursor? so when i move the cursor it follows it? also how do i play an animation on click?
    My  idea for the game is to have a rhythm style game where the player moves the net and catches the bee's, something i thought would be simple to figure out how to do
    This is my game at the minute, ive used the code we were told to copy from sheets and just changed the sprites :\ any help would be amazing!
    https://www.dropbox.com/s/1pjbv2mavycsi3q/sopaceship%20rev7%20%20moving%20bullet.fla

    http://orangesplotch.com/blog/flash-tutorial-elastic-object-follower/
    var distx:Number;
    var disty:Number;
    var momentumx:Number;
    var momentumy:Number;
    follower.addEventListener(Event.ENTER_FRAME, FollowMouse)
    function FollowMouse(event:Event):void {
         // follow the mouse in a more elastic way
         // by using momentum
         distx = follower.x - mouseX;
         disty = follower.y - mouseY;
         momentumx -= distx / 3;
         momentumy -= disty / 3;
         // dampen the momentum a little
         momentumx *= 0.75;
         momentumy *= 0.75;
         // go get that mouse!
         follower.x += momentumx;
         follower.y += momentumy;

  • I need help with ipod games...

    Dear other Itunes users,
    I have multiple libraries that I currently use. The problem is not that I can not successfully get the games on the ipod, but that all the games(purchased on different computers) cannot coexist on the ipod. The message warns me and states that it will replace the other games I purchased with the games from my current library. How can I fix this?
    Thank you, tjd51.

    Use the Transfer Purchases option to place all of the games on one computer, and then sync the games from that computer.
    (30664)

  • Help with lingo game

    Hey guys,
    i'm making an adventure style game using lingo. But i can't
    figure out how to make my sprite transport from room to room. I'd
    like the character to go up to the door either push space or click
    on the door (maybe a notice comes up?) then appear in another room.
    I've looked for tutorials on this kind of thing but have been
    unsuccessful. Can anyone help me? I learn better from one to one
    and would really appreciate anyone with some spare time. I have a
    private email address is this is better.
    Thanx so much guys. x

    it's a 2d game. I've figured out the marker thing now and i'm
    happy with clicking on the door rather than using space bar to go
    from room to room. I wonder if you could help me with a new problem
    though? lol, here it is;
    Hey guys, can anyone help me?
    Here is some script that makes my character obviously move
    and detects walls. I would like to modify the script so that when
    my character hits the right keydown, the sprite changes to cast
    member "right". I have tried and so far all i have done is succeed
    in making the cast member change but this then deactivates the
    walls. Any ideas??
    on exitFrame me
    if keyPressed(123) then
    move(me,-5,0)
    end if
    if keyPressed(124) then
    move(me,5,0)
    end if
    if keyPressed(125) then
    move(me,0,5)
    end if
    if keyPressed(126) then
    move(me,0,-5)
    end if
    end
    on move me, dx, dy
    oldRect = sprite(me.spritenum).rect
    newRect = oldRect + rect(dx,dy,dx,dy)
    hitWall = FALSE
    repeat with i = 2 to 30
    if sendSprite(i,#hitWall,newRect) then
    hitWall = TRUE
    exit repeat
    end if
    end repeat
    if not hitWall then
    sprite(me.spriteNum).loc = sprite(me.spriteNum).loc +
    point(dx,dy)
    end if
    end
    Many thanks.

  • Please! I need someone help with a game

    I got this Error everytime the scene is reseted. I have no clue where mistake is made. Please help!
    TypeError: Error #1010: A term is undefined and has no properties.
        at golfer_fla::MainTimeline/resetScene()
        at golfer_fla::MainTimeline/golfer_fla::frame1()
    TypeError: Error #1010: A term is undefined and has no properties.
        at golfer_fla::MainTimeline/resetScene()
        at golfer_fla::MainTimeline/countDown()
        at flash.utils::Timer/flash.utils:Timer::_timerDispatch()
        at flash.utils::Timer/flash.utils:Timer::tick()
    If that helps I could send my game by mail so someone could check the error which constantly pop out when the golfer hit the ball, ball stops and the scene resets.
    Here is the code:
    //Variables
    var myHead = new head();
    var myArms = new arms();
    var myBody = new body();
    var myStick = new stick();
    var myGround = new ground();
    var myFlag = new flag();
    var myCapsel = new capsel();
    var grassMask:Number;
    var speedUp:int = 2;
    var speedDown:int = speedUp * 8;
    var checker:int;
    var minPower:int;
    var maxPower:int = 110;
    var strength:Number;
    var capselPower:Number;
    var distance:Number;
    var target:int;
    var tryShot:int = 0;
    var myTimer = new Timer(2000, 1);
    //EventListeners
    stage.addEventListener(KeyboardEvent.KEY_DOWN, onDown);
    stage.addEventListener(KeyboardEvent.KEY_UP, onUp);
    stage.addEventListener(Event.ENTER_FRAME, hit);
    myTimer.addEventListener(TimerEvent.TIMER, countDown);
    //Functions
    function resetScene():void {   
        addChild(myBody);
        addChild(myArms);
        addChild(myHead);
        addChild(myStick);
        addChild(myGround);
        addChild(myFlag);
        addChild(myCapsel);
        grassMask = (320 + Math.random()*260);
        myBody.x = 70;
        myBody.y = 296;
        myArms.x = 68;
        myArms.y = 276;
        myArms.rotation = 0;
        myHead.x = 70;
        myHead.y = 215;   
        myStick.x = 68;
        myStick.y = 276;   
        myStick.rotation = 0;
        myCapsel.x = 90;
        myCapsel.y = 331;
        myGround.x = 0;
        myGround.y = 375;
        myGround.grassMask.x = grassMask - 610;
        myFlag.x = grassMask;
        myFlag.y = 375;
        checker = 0;
        minPower = 0;
        target = 0;
        tryShot ++;
        myCapsel.capselFall.gotoAndStop(1);
        myMessage.text = "Press any key!";
    resetScene();
    function invisibleCapsels():void {   
        a1.visible = false;
        a2.visible = false;
        a3.visible = false;
        a4.visible = false;
        a5.visible = false;
        a6.visible = false;
        a1.gotoAndStop(1);
        a2.gotoAndStop(1);
        a3.gotoAndStop(1);
        a4.gotoAndStop(1);
        a5.gotoAndStop(1);
        a6.gotoAndStop(1);
    invisibleCapsels();
    function onDown(e:KeyboardEvent):void {
        checker = 1;
        minPower = -20;
    function onUp(e:KeyboardEvent):void {
        checker = 0;
        capselPower = (myCapsel.x + myStick.rotation) * 3.2;
    function hit(e:Event):void {
        if(tryShot < 7) {
            if((checker == 1) && (myStick.rotation < maxPower)) {
                myStick.rotation += speedUp;
                myArms.rotation += speedUp;
                } else {
                    if(myStick.rotation > minPower) {
                        myStick.rotation -= speedDown;
                        myArms.rotation -= speedDown;
                    if(myStick.hitTestObject(myCapsel)) {
                        stage.addEventListener(Event.ENTER_FRAME, shot);
                } else {
                    myMessage.text = "Game Over\nClick to play again";
                    stage.addEventListener(MouseEvent.MOUSE_DOWN, playAgain);
    function playAgain(e:MouseEvent):void {
        resetScene();
        invisibleCapsels();
        tryShot = 1;
        stage.removeEventListener(MouseEvent.MOUSE_DOWN, playAgain);
    function shot(e:Event):void {
        strength = (capselPower - myCapsel.x);
        distance = grassMask - myCapsel.x;
        if((Math.round(distance) <= 10) && (Math.round(distance) >= 3) && (strength <= 65)) {
            if(target == 0) {
                myCapsel.capselFall.play();
                myCapsel.rotation = 0;
                target = 1;
                this["a" + tryShot].visible = true;
                myMessage.text = "Cooool!";
                myTimer.start();
            } else {
                if(strength > 5) {
                    myCapsel.x += strength / 30;
                    myCapsel.rotation += strength / 4;
                    } else {
                        this["a" + tryShot].visible = true;
                        this["a" + tryShot].gotoAndStop(2);
                        myMessage.text = "Bad Luck!";
                        myTimer.start();
    function countDown(e:TimerEvent):void {
        resetScene();
        stage.removeEventListener(Event.ENTER_FRAME, shot);

    Try adding the following two lines before line 59:
    trace(myCapsel);
    trace(myCapsel.capselFall);
    If one of them traces undefined, it should isolate which object is the problem.  If you describe what is involved with that object.child, then it may help generate an idea of what might be wrong.

  • Help with platform game

    I can't solve this for days already... When the hero object dies, the floorObject do not remove completely, such that one of them remains. And the hero object
    disappears. Thanks for all the help.
    package
              import flash.display.MovieClip;
              import flash.events.KeyboardEvent;
              import flash.events.*;
              import flash.utils.getTimer;
              public class Platform extends MovieClip
                        // movement constants
                        static const gravity:Number = .004;
                        // screen constants
                        static const edgeDistance:Number = 100;
                        // object arrays
                        private var fixedObjects:Array;
                        private var otherObjects:Array;
                        // hero and enemies
                        private var hero:Object;
                        private var enemies:Array;
                        // game state
                        private var playerObjects:Array;
                        private var gameScore:int;
                        private var gameMode:String = "start";
                        private var playerLives:int;
                        private var lastTime:Number = 0;
                        private var currentX:int = 0;
                        public function startPlatformGame()
                                  // constructor code
                                  gameMode = "play";
                        public function startGameLevel()
                                  createHero();
                                  addEnemies();
                                  // examine level and note all objects
                                  examineLevel();
                                  // add listeners
                                  this.addEventListener(Event.ENTER_FRAME,gameLoop);
                                  stage.addEventListener(KeyboardEvent.KEY_DOWN,keyDownFunction);
                                  stage.addEventListener(KeyboardEvent.KEY_UP,keyUpFunction);
                                  // set game state
                                  gameMode = "play";
                        public function createHero()
                                  hero = new Object();
                                  hero.mc = gamelevel.hero;
                                  hero.dx = 0.0;
                                  hero.dy = 0.0;
                                  hero.inAir = false;
                                  hero.direction = 1;
                                  hero.animstate = "stand";
                                  hero.walkAnimation = new Array(2,3,4,5,6,7,8);
                                  hero.animstep = 0;
                                  hero.jump = false;
                                  hero.moveLeft = false;
                                  hero.moveRight = true;
                                  hero.jumpSpeed = .8;
                                  hero.walkSpeed = .15;
                                  hero.width = 30.0;
                                  hero.height = 40.0;
                                  hero.startx = hero.mc.x;
                                  hero.starty = hero.mc.y;
                        public function addEnemies() {
                                  enemies = new Array();
                                  var i:int = 1;
                                  while (true) {
                                            if (gamelevel["enemy"+i] == null) break;
                                            var enemy = new Object();
                                            enemy.mc = gamelevel["enemy"+i];
                                            enemy.dx = 0.0;
                                            enemy.dy = 0.0;
                                            enemy.inAir = false;
                                            enemy.direction = 1;
                                            enemy.animstate = "stand"
                                            enemy.walkAnimation = new Array(2,3,4,5);
                                            enemy.animstep = 0;
                                            enemy.jump = false;
                                            enemy.moveRight = true;
                                            enemy.moveLeft = false;
                                            enemy.jumpSpeed = 1.0;
                                            enemy.walkSpeed = .08;
                                            enemy.width = 30.0;
                                            enemy.height = 30.0;
                                            enemies.push(enemy);
                                            i++;
                        public function examineLevel()
                                  fixedObjects = new Array();
                                  otherObjects = new Array();
                                  for (var i:int=0; i<this.gamelevel.numChildren; i++)
                                            var mc = this.gamelevel.getChildAt(i);
                                            // add floors and walls to fixedObjects
                                            if (mc is Floor)
                                                      var floorObject:Object = new Object();
                                                      floorObject.mc = mc;
                                                      floorObject.leftside = mc.x;
                                                      floorObject.rightside = mc.x + mc.width;
                                                      floorObject.topside = mc.y;
                                                      floorObject.bottomside = mc.y + mc.height;
                                                      fixedObjects.push(floorObject);
                                            else if ((mc is Treasure) )
                                                      otherObjects.push(mc);
                                  fixedObjects.sortOn("leftside" , Array.NUMERIC );
                                  for each (floorObject in fixedObjects)
                                            trace(floorObject.leftside);
                        // add treasure, key and door to otherOjects;
                        public function keyDownFunction(event:KeyboardEvent)
                                  if (gameMode != "play")
                                            return;
                                  }// don't move until in play mode
                                  if (event.keyCode == 37)
                                            hero.moveLeft = true;
                                  else if (event.keyCode == 39)
                                            hero.moveRight = true;
                                  else if (event.keyCode == 32)
                                            if (! hero.inAir)
                                                      hero.jump = true;
                        public function keyUpFunction(event:KeyboardEvent)
                                  if (event.keyCode == 37)
                                            hero.moveLeft = false;
                                  else if (event.keyCode == 39)
                                            hero.moveRight = false;
                        public function gameLoop(event:Event)
                                  // get time differentce
                                  if (lastTime == 0)
                                            lastTime = getTimer();
                                  var timeDiff:int = getTimer() - lastTime;
                                  lastTime +=  timeDiff;
                                  // only perform tasks if in play mode
                                  if (gameMode == "play")
                                            moveCharacter(hero,timeDiff);
                                            checkCollisions();
                                            scrollWithHero();
                                            death();
                        public function moveCharacter(char:Object,timeDiff:Number)
                                  if (timeDiff < 1)
                                            return;
                                  // assume character pulled down by gravity
                                  var verticalChange:Number = char.dy * timeDiff + timeDiff * gravity;
                                  if (verticalChange > 15.0)
                                            verticalChange = 15.0;
                                  char.dy +=  timeDiff * gravity;
                                  // react to changes from key presses
                                  var horizontalChange = 0;
                                  var newAnimState:String = "stand";
                                  var newDirection:int = char.direction;
                                  if (char.moveLeft)
                                            // walk left
                                            horizontalChange =  -  char.walkSpeed * timeDiff;
                                            newAnimState = "walk";
                                            newDirection = -1;
                                  else if (char.moveRight)
                                            // walk right
                                            horizontalChange = char.walkSpeed * timeDiff;
                                            newAnimState = "walk";
                                            newDirection = 1;
                                  if (char.jump)
                                            // start jump
                                            char.jump = false;
                                            char.dy =  -  char.jumpSpeed;
                                            verticalChange =  -  char.jumpSpeed;
                                            newAnimState = "jump";
                                  // assume no wall hit, and hanging in air
                                  char.hitWallRight = false;
                                  char.hitWallLeft = false;
                                  char.inAir = true;
                                  // find new vertical position
                                  var newY:Number = char.mc.y + verticalChange;
                                  // loop through all fixed objects to see if character has landed
                                  for (var i:int=0; i<fixedObjects.length; i++)
                                            if ((char.mc.x+char.width/2 > fixedObjects[i].leftside) && (char.mc.x-char.width/2 < fixedObjects[i].rightside))
                                                      if ((char.mc.y <= fixedObjects[i].topside) && (newY > fixedObjects[i].topside))
                                                                newY = fixedObjects[i].topside;
                                                                char.dy = 0;
                                                                char.inAir = false;
                                                                break;
                                  // find new horizontal position
                                  var newX:Number = char.mc.x + horizontalChange;
                                  // loop through all objects to see if character has bumped into a wall
                                  for (i=0; i<fixedObjects.length; i++)
                                            if ((newY > fixedObjects[i].topside) && (newY-char.height < fixedObjects[i].bottomside))
                                                      if ((char.mc.x-char.width/2 >= fixedObjects[i].rightside) && (newX-char.width/2 <= fixedObjects[i].rightside))
                                                                newX = fixedObjects[i].rightside + char.width / 2;
                                                                char.hitWallLeft = true;
                                                                break;
                                                      if ((char.mc.x+char.width/2 <= fixedObjects[i].leftside) && (newX+char.width/2 >= fixedObjects[i].leftside))
                                                                newX = fixedObjects[i].leftside - char.width / 2;
                                                                char.hitWallRight = true;
                                                                break;
                                  // set position of character
                                  char.mc.x = newX;
                                  char.mc.y = newY;
                                  // set animation state
                                  if (char.inAir)
                                            newAnimState = "jump";
                                  char.animstate = newAnimState;
                                  // move along walk cycle
                                  if (char.animstate == "walk")
                                            char.animstep +=  timeDiff / 60;
                                            if (char.animstep > char.walkAnimation.length)
                                                      char.animstep = 0;
                                            char.mc.gotoAndStop(char.walkAnimation[Math.floor(char.animstep)]);
                                            // not walking, show stand or jump state
                                  else
                                            char.mc.gotoAndStop(char.animstate);
                                  // changed directions
                                  if (newDirection != char.direction)
                                            char.direction = newDirection;
                                            char.mc.scaleX = char.direction;
                        public function checkCollisions()
                                  for (var i = otherObjects.length-1; i >= 0; i--)
                                            if (hero.mc.hitTestObject(otherObjects[i]))
                                                      getObject(i);
                                  for (var j:int = enemies.length-1; j>=0; j--)
                                            if (hero.mc.hitTestObject(enemies[j].mc))
                                                      currentX = hero.mc.x;
                                                      gameComplete();
                        public function scrollWithHero()
                                  var stagePosition:Number = gamelevel.x + hero.mc.x;
                                  var rightEdge:Number = stage.stageWidth - edgeDistance;
                                  var leftEdge:Number = edgeDistance;
                                  if (stagePosition > rightEdge)
                                            gamelevel.x -= (stagePosition-rightEdge);
                                            if (gamelevel.x < -(gamelevel.width-stage.stageWidth))
                                                      gamelevel.x = -(gamelevel.width-stage.stageWidth);
                                  if (stagePosition < leftEdge)
                                            gamelevel.x += (leftEdge-stagePosition);
                                            if (gamelevel.x > 0)
                                                      gamelevel.x = 0;
                        public function getObject(objectNum:int)
                                  if (otherObjects[objectNum] is Treasure)
                                            gamelevel.removeChild(otherObjects[objectNum]);
                                            otherObjects.splice(objectNum,1);
                        public function death()
                                  if (hero.mc.y > 300)
                                            currentX = gamelevel.hero.x;
                                            trace(currentX);
                                            gameComplete();
                        public function gameComplete()
                                  gameMode = "dead";
                                  var dialog:Dialog = new Dialog();
                                  dialog.x = 175;
                                  dialog.y = 100;
                                  addChild(dialog);
                                  dialog.message.text = "Gameover";
                        public function clickDialogButton(event:MouseEvent)
                                  removeChild(MovieClip(event.currentTarget.parent));
                                  // new life, restart, or go to next level
                                  if (gameMode == "dead")
                                            // reset hero
                                            hero.mc.x = currentX;
                                            hero.mc.y = 0;
                                            trace("dead");
                                            setReplay();
                                            gameMode = "play";
                                  // give stage back the keyboard focus
                                  stage.focus = stage;
                        public function setReplay()
                                  for (var i:int = fixedObjects.length-1; i>-1; i--)
                                            if (fixedObjects[i].leftside < currentX)
                                                      this.gamelevel.removeChildAt(fixedObjects[i]);
                                                      fixedObjects.splice(i,1);
                                                      trace("Splice?");
                                  for each (var floorObject in fixedObjects){
                                            trace(floorObject.leftside);
                        public function cleanUp()
                                  removeChild(gamelevel);
                                  this.removeEventListener(Event.ENTER_FRAME,gameLoop);
                                  stage.removeEventListener(KeyboardEvent.KEY_DOWN,keyDownFunction);
                                  stage.removeEventListener(KeyboardEvent.KEY_UP,keyUpFunction);

    Ok, I fiured it all out, the other way you mentioned. Just opened up the character MC, and named 2 frames. One LEFT and one RIGHT. Then I added a few simple lines of code, and turned out with this:
    if (Key.isDown(Key.RIGHT)) {
    _x += speed;
    this.gotoAndStop("right");
    if (Key.isDown(Key.LEFT)) {
    _x -= speed;
    this.gotoAndStop("left");
    Thanks for helping!!!

  • Help with war game

    I am learning java and was looking at this program I don't understand what is wrong with it, I am getting an error that says something about the compareTo cannot be found and variable cannot be found.
    class Card implements Comparable
    Card(int r, int s)
    rank = r;
    suit = s;
    int getRank()
    return rank;
    int getSuit()
    return suit;
    public int compareTo(Object ob)
    Card other = (Card)ob;
    int thisRank = this.getRank();
    int otherRank = other.getRank();
    if (thisRank == 1) thisRank = 14; // make aces high
    if (otherRank == 1) otherRank = 14;
    return thisRank - otherRank;
    public boolean equals(Object ob)
    if (ob instanceof Card)
    Card other = (Card)ob;
    return value==other.value && suit==other.suit;
    else return false;
    public String toString()
    String val;
    String [] suitList =
    { "", "Clubs", "Diamonds", "Hearts", "Spades" };
    if (rank == 1) val = "Ace";
    else if (rank == 11) val = "Jack";
    else if (rank == 12) val = "Queen";
    else if (rank == 13) val = "King";
    else val = String.valueOf(rank); // int to String
    String s = val + " of " + suitList[suit];
    for (int k=s.length()+1; k<=17; k++) s = s + " ";
    return s;
    private int rank;
    private int suit;
    class CardDeck
    CardDeck()
    deck = new Card [52];
    fill();
    void shuffle()
    for (int next = 0; next < numCards-1; next++)
    int r = myRandom(next, numCards-1);
    Card temp = deck[next];
    deck[next] = deck[r];
    deck[r] = temp;
    Card deal()
    if (numCards == 0) return null;
    numCards--;
    return deck[numCards];
    int getSize()
    return numCards;
    private void fill()
    int index = 0;
    for (int r = 1; r <= 13; r++)
    for (int s = 1; s <= 4; s++)
    deck[index] = new Card(r, s);
    index++;
    numCards = 52;
    private static int myRandom(int low, int high)
    return (int)((high+1-low)*Math.random()+low);
    private Card [] deck;
    private int numCards;
    class Pile
    Pile()
    pile = new Card[52];
    front = 0; end = 0;
    int getSize()
    return end - front;
    void clear()
    front = 0; end = 0;
    void addCard(Card c)
    pile[end] = c;
    end++;
    void addCards(Pile p)
    while (p.getSize() > 0)
    addCard(p.nextCard());
    Card nextCard()
    if (front == end)
    return null; // should not happen
    Card c = pile[front];
    front++;
    return c;
    private Card [] pile;
    private int front, end; // front &#8804; end
    class Player
    Player(String n)
    name = n;
    playPile = new Pile();
    wonPile = new Pile();
    Card playCard()
    if (playPile.getSize() == 0)
    useWonPile();
    if (playPile.getSize() > 0)
    return playPile.nextCard();
    return null;
    String getName()
    return name;
    void collectCard(Card c)
    wonPile.addCard?;
    void collectCards(Pile p)
    wonPile.addCards(p);
    void useWonPile()
    playPile.clear(); // reset front and end to 0
    playPile.addCards(wonPile);
    wonPile.clear(); // reset front and end to 0
    int numCards()
    return playPile.getSize() + wonPile.getSize();
    private Pile playPile, wonPile;
    private String name;
    class Game
    void play()
    CardDeck cd = new CardDeck();
    cd.shuffle();
    p1 = new Player("Ernie");
    p2 = new Player("Burt");
    while (cd.getSize() >= 2)
    p1.collectCard(cd.deal());
    p2.collectCard(cd.deal());
    p1.useWonPile();
    p2.useWonPile();
    Pile down = new Pile(); // Pile for cards in a war
    loop: for (int t=1; t<=100; t++)
    if (!enoughCards(1)) break loop;
    Card c1 = p1.playCard();
    Card c2 = p2.playCard();
    System.out.println("\nTurn " + t + ": ");
    System.out.print(p1.getName() + ": " + c1 + " ");
    System.out.print(p2.getName() + ": " + c2 + " ");
    if (c1.compareTo(c2) > 0)
    p1.collectCard(c1); p1.collectCard(c2);
    else if (c1.compareTo(c2) < 0)
    p2.collectCard(c1); p2.collectCard(c2);
    else // War
    down.clear();
    down.addCard(c1); down.addCard(c2);
    boolean done = false;
    do
    { int num = c1.getRank();
    if (!enoughCards(num)) break loop;
    System.out.print("\nWar! Players put down ");
    System.out.println(num + " card(s).");
    for (int m=1; m<=num; m++)
    c1 = p1.playCard(); c2 = p2.playCard();
    down.addCard(c1);
    down.addCard(c2);
    System.out.print(p1.getName()+": "+ c1 + " ");
    System.out.print(p2.getName()+": " + c2 + " ");
    if (c1.compareTo(c2) > 0)
    { p1.collectCards(down);
    done = true;
    else if (c1.compareTo(c2) < 0)
    { p2.collectCards(down);
    done = true;
    while (!done);
    } // end of for t=1 to 100
    System.out.println(p1.numCards() + " to "
    + p2.numCards());
    boolean enoughCards(int n)
    if (p1.numCards() < n || p2.numCards() < n)
    return false;
    return true;
    Player getWinner()
    if (p1.numCards() > p2.numCards())
    return p1;
    else if (p2.numCards() > p1.numCards())
    return p2;
    else
    return null;
    private Player p1, p2;
    public class War
    public static void main(String [] args)
    Game g = new Game();
    g.play();
    Player winner = g.getWinner();
    if (winner == null) System.out.println("Tie game.");
    else System.out.println("\nWinner = "
    + winner.getName());
    Message was edited by:
    thunderbbolt

    return value==other.value && suit==other.suit;I don't see a variable named value defined anywhere either. Do you? I do see rank and suit variables though.

  • Help With Online Game (Walking Talking)...

    Hello, I just want to make like something like a game where you conrol a box, and can write messages to other people...
    But the thing is that i am absolutely new in JAVA i don't know anything in it (totally)
    So i would like to get some information in working with it... and things like that ^.^
    P.S. I worked with GameMaker but I don't think that it will help me :|

    I Don't know but it' didn't work maybe cause i am using vista???
    when it didn't work i made a bat file and wrote there: javac HelloWorldApp.java
    i think it did something but new file didn't appear anywhere. maybe it shuld appear in any other folder or something?
    EDIT: I thought that vista doesn't let me to make new files in C disk so i copied the *.java file to the desktop and when i cmd i tried to javac it, the compiler started writing:
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    C:\Users\TDEsws\Desktop>javac HelloWorldApp.java
    by his self... it didn't stop waited about 30seconds...
    Edited by: TDEsws on Nov 5, 2008 5:37 AM

  • Help with learning project

    I'm not an experienced programmer and I'm just trying to learn some more. I started a very demanding project which most likely won't ever finish but it doesn't have to either. Learning is the key.
    I'm building a game, a roguelike to be exact. I'm sure you all know what those are like. Adom, nethack and so forth.
    What would be the best way to create the playing area with swing? That area where all the characters are placed and the player character and monsters move around? Is there some quick way to create an area that would be a table with coordinates that I could manipulate? Insert and remove characters, change colours and alike.
    I don't need exact code but some directions. If it's complicated and you want to link some example code I won't mind though.
    Thanks in advance :)

    I'm not an experienced programmer and I'm justtrying
    to learn some more. Urelated but important questions:
    1) Are you in or have you taken a java class?
    2) Have you gone completely through one or more java
    textbooks chapter by chapter?I've read a few books and completed a few assignments. I know the basics such as using objects, different classes outside the main class, using functions and building algorithms. Swing isn't very familiar to be but it's one of the reasons why I chose to do this with it.
    Just throwing ideas out here. You might want to ask on the Swing forum...I think those were good ideas. I suspected there were a lot of choices and that gave me some ideas. I'll check the Swing forum too. Perhaps I should have posted there in the first place.

  • Help with learning Triggers

    Hello,
    I'm afraid this is a very basic question from someone just learning Oracle.
    I have downloaded 10g onto my work Windows XP laptop.
    When trying to create a trigger through sql*plus, I keep getting 'trigger created with compilation errors'
    When going to EM, I keep getting :
    "SQL Error
    Failed to commit: ORA-04072: invalid trigger type"
    This happens with any combination of before/after update,insert,delete - and it's stumping me. i was just working my through an easy example in a book.
    here's the trigger body from the EM:
    after insert or update on integers #no matter what combination i use , i get the same
    for each row
    begin
    end;
    That error:
    Oracle Error :: ORA-04072
    Specify either INSERT, UPDATE or DELETE.
    Am i making some obvious typo that i just can't see????
    Thanks for any help, it's appreciated....

    it's just the most basic learning example.........
    the table........
    SQL> select * from integers;
    C1 C2
    1 odd
    2 even
    3 odd
    4 even
    5 odd
    7 odd
    7 even
    7 rows selected.
    and as for the trigger, as i posted above, i took out everythinng from the body eventually as i tried every combination of before/after insert/update/delete and still kept getting the same error (with or wihtout anything in the body).
    trigger:
    create or replace trigger tg
    after insert or update on integers
    for each row
    begin
    end;
    thanks!

  • Need help with a game..

    I was wondering if anyone can help me out with a little problem.
    Little info about the code:
    I am creating a game, where a player has to answer a set of math questions with answers that are only
    in whole numbers. If you look at method: showQuestion() I have used a for loop show the question on a
    label. There are no compile errors. So i assume, the problem is related to exception handling or something
    the problem:
    if you look at the last method actionPerformed(ActionEvent e), in there when you click the nextQ button
    i get paragraphs exception errors, or so i think there exceptions, im new to programming so tend to get
    jumbled now and again.
    extra info:
    There is another class called Questions, too long to paste here, but in that class i have defined
    the questions and corresponding answers in arrays as such:
    String[] Questions = new String[50];
    int [] Answers = new int[50]
         Question[0] = "What is 2 x 8? ";
         Answer[0] = 16;
         etc etc for the entire 50 questions. so you get my idea here.
    again if you look at showQuestion() whatever question is displayed its answer is worked out using the
    index i.
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class Game extends Questions implements ActionListener
        /** Global Variables Declared */
        /** Global Variables for Components in GUI */
        /** Constructor initialise game */
        public void showQuestion()
            int i;
                for(i=0; i<Questions.length; i++)
                        showQuestion.setText(Questions);
    Answer = Answers[i];
    public void makeFrame()
    // Creates Frame
    // Labels
    // TextBox for user input
    // Buttons
    // Sets Frame size
    // Listen to events (addActionListener)
    // Container ContentPane and add components to it
    // Frame Close and Visibility properties
    public void actionPerformed(ActionEvent e)
    // if QuitGame button is pressed do the following...
    if(e.getSource()==NextQ) {
    showQuestion.setText("Question 1: " + Questions[i]);
    else {            

    Dude are all 50 questions and answers in the array occupied?
    * array.length is the capacity of the array, not "how many are occupied".
    2. You're typically better of using an ArrayList instead of an array, because ArrayList's are resized dynamically.
    3. don't use "paralell" arrays... instead create a class which keeps your shite together, and then create a collection of them... something like...
    class QuestionTO { // to stands for Tranfer Object
      private final String question;
      private final String answer;
      public QuestionTO(String question, String answer) {
        this.question = question;
        this.answer = answer;
      public String getQuestion() { return this.question; }
      public String getAnswer() { return this.answer; }
      public String toString("<Question question=\""+getQuestion()+"\" answer=\""+getAnswer()+"\" />");
    class Questionarre {
      List<QuestionTO> questions = new ArrayList<QuestionTO>();
      public void print(PrintStream out) {
        for (QuestionTO question : questions) {
          out.println(question.toString()));
    }Hope that helps some... even if it's "a bit beyond" you at the moment... doing stuff "the proper way" is most often easier, coz the super-geeks have done most of the heavy lifting for you.
    Keith.

  • I need help with a game called "sticks"...go figure(!)

    Help! I have just started using Java, and already I need to create a simple game, but I am having problems already.
    The game is designed for 2 player with the one human player and the computer. Players alternatively take sticks from a pile, the player taking the last stick loses.
    Any Ideas?
    Many Thanks...
    Dr. K

    If I take a stick and then smash the computer to pieces with it, do I win???

  • Help with j2me games

    I'm a student that needs help for my school thesis.I'm new to j2me. I'm trying to develop a multiplayer game via GPRS. i have a few general question to ask.I',m doing a round robin game.
    1) I saw in the nokia forum about the http server and tcp server. What is the main difference?Isn't the internet stack is divided to application, transport and network layer and so on?why will have http server and tcp server?isn't that tcp connection also implemented in http server?
    2) In the http server, the server won't start a connection with the client. If i send a http request to the server to start a new game with my opponent, how do the server will nodify my opponent?My opponent don't know i'm sending a game to him.
    3) Is that tcp server has already successfully implemented now?Is there any free tcp server or i need to code it in J2se?
    4) Is that using WAP or IP router to send the internet stack to the server?Which 1 is better?

    internet stack is divided to application, transport
    and network layer and so on?Yes, but a mobile might not have a IP stack, instead a simple connection to a proxy server, which "talks" to the net.
    how do the server will nodify my opponent?My opponent
    don't know i'm sending a game to him.Perodic updates (polling).
    3) Is that tcp server has already successfully
    implemented now?I dont understand the question. Has anyone used TCP/IP on mobile phones (as client software), yes me: http://j2mevnc.sourceforge.net
    Has anyone used the serversocket. Other than demo-ware, not that I know of, not many phones support socket://, let alone serversocket://
    4) Is that using WAP or IP router to send the internet
    stack to the server?Which 1 is better?Depends on your need.

  • Help with transfering games

    I have tried to download games but it keeps saying I have to go to the store and authorize computer..I have already authorized it before and when I went back to the store to find the authorized computer selection I could not find it.. Help please

    As noted by chris above the games are not compatible with the ipod nano only the larger ipod video. THe games on th eitunes music store in fact make this warning known jsut below the game description
    "...THese games are CANNOT be played in itunes, NOR are they COMPATIBLE with other IPOD MODELS." Nor can they be playyed in itunes.
    With the emphasis given of course. I dont believe you can get a refund because the system requirements are clearly noted. On another note the ipod nano is Not able to play ANy video content including podcasts. IF you wish for either of these features youll need the ipod video.
    GFF:)

  • Help with ipod games!!!

    i cant get games to go on my ipod :s
    do you just download them and the are they supposed to go on your ipod when you plug it on because if that is whats supposed to happen then mine does not do that and i really dont understand how to get them on? it is an ipod nano i am tryin to get the game on? please help x

    As noted by chris above the games are not compatible with the ipod nano only the larger ipod video. THe games on th eitunes music store in fact make this warning known jsut below the game description
    "...THese games are CANNOT be played in itunes, NOR are they COMPATIBLE with other IPOD MODELS." Nor can they be playyed in itunes.
    With the emphasis given of course. I dont believe you can get a refund because the system requirements are clearly noted. On another note the ipod nano is Not able to play ANy video content including podcasts. IF you wish for either of these features youll need the ipod video.
    GFF:)

Maybe you are looking for

  • WARNING:Could not lower the asynch I/O limit to 224 for SQL direct I/O. It is set to -1

    Hi, We have recently upgraded single instance database to 10.2.0.5 patch set 4 on windows server 2003 64 bit After upgrading we are facing  issue of number of warnings in trace files (bdump) WARNING:Could not lower the asynch I/O limit to 224 for SQL

  • Restore PDF presets in InDesign CS6

    While using InDesign CS6, I went to export a pdf and found the presets were gone, same for Illustrator CS6. I have been able to find old presets on the forum but none that include X-4:2008. How can I restore all the presets? Thanks.

  • 4inone drivers via kt3ultra amd apollochipset

    I am having problems installing my 4in1 drivers they will not install properly on windows me every time i do they mess up i have a kt3ultra apollo chipset .Can anyone give me any answer to these problems because after i install everything goes crazy

  • Watching videos on external TV with laptop monitor off?

    Hi, I'd like to view some of my iTunes videos on an external TV but with my G4 Powerbook's monitor off. (Watching full screen videos in full screen mode on the laptop itself tends to produce intense heat and resulting fan noise.) I connected the lapt

  • How to calculate total value in categories?

    I know Numbers let you do subtotal in categories. However at the end of the table, i want a nice total value in a single row that is not in under any category. For example, Number's Home Inventory Template, when you want open a new file. It has Maste