Loading...
Logo
Processing Forum
bokin6's Profile
2 Posts
5 Responses
0 Followers

Activity Trend

Last 30 days
Show:
Private Message
    I've made a very rough herding game.

    I have the dog that herds the sheep which is the player and an enemy (the hawk) that eats the sheep.
    Currently when the hawk hits the sheep the lives decrease as long as the two are intersecting (which is often for quite a while). I need the lives to only descrease by 1 when the hawk and sheep intersect. I would also like if the sheep disappeared when this happened but one thing at a timre.

     this is the specific area in the code where it happens:

    1.     if ( intersectv(enemy.hawkpos, enemy.d, sheep[i].pos, sheep[i].d) == true ) {
            // background(100, 0, 0);
            lives--;     
          //  freeLife.active = false;
          }

    here's a link to the .zip file of my code:
    http://www.auriceye.com/outline10.zip
    Hello, I tried to wrap my head around the concept but have no idea how to execute it.
    I've made a tic tac toe game.
    I've made an array to have 2 players.
    char[] player = new char[2];
    player[0] = 'X';
    player[1] = 'O';
    My problem is trying to get these 2 players to alternate.
    I was told to put "playerIndex = !playerIndex;" under mouseClicked function but obviously processing tells me "Cannot find anything named playerIndex" so what do I need to add or define in order to get my players to switch??
    Thanks!