Page 3 of 6 FirstFirst 123456 LastLast
Results 21 to 30 of 55

Thread: Noob Question

                  
   
  1. #21
    DCEmu Coder splodger15's Avatar
    Join Date
    Jun 2006
    Location
    London
    Age
    34
    Posts
    4,123
    Rep Power
    95

    Default

    The difference between C and C++ is as follows:

    C++ has Object Oriented programming (such as Classes and polymophism)...in essence objects of things are defined and shaped...it more matches real-world representation and makes development more elegant and faster to create.

    C is the predecessor older language which was strictly structured programming....which just means you did everything in functions with no true collectiveness grouping among them


    C++ is a far more powerfull language

    PSN ID: splodger15

  2. #22
    DCEmu Rookie
    Join Date
    May 2007
    Location
    Under your Bed
    Posts
    168
    Rep Power
    0

    Default

    ok thank you for explaining that, But i have another question about coding, how do i detect hits? i am making a space invaders clone, i made the ship, got it to move and shoot, but now i need to learn to know when it hits stuff like an alien.

  3. #23
    DCEmu Pro dangee's Avatar
    Join Date
    Feb 2007
    Posts
    531
    Rep Power
    69

    Smile

    so good to hear you got stuff moving.
    the common method of hit detection involves using the
    screen position (x,y) , and
    size (width,height) properties of your
    sprite objects to find if any of them overlap.
    (eg using the inequality operators )

  4. #24
    DCEmu Rookie
    Join Date
    May 2007
    Location
    Under your Bed
    Posts
    168
    Rep Power
    0

    Default

    how exactly would i type that?
    EDIT::i tired it this way, i made it so that whenever the laser's x and y posistion are greater than or lesser than a certain number, it works, but if there is a better way to do this please tell me. Here is what it looks like
    if(lx > 15 && lx < 45 && ly < 135 && ly > 105){
    inv1stat = 0;
    }

  5. #25
    DCEmu Pro dangee's Avatar
    Join Date
    Feb 2007
    Posts
    531
    Rep Power
    69

    Default

    Just so.
    At this stage in the programs dev. cycle, its useful to establish
    all the main() flow control blocks and data objects, before
    enhancements and optimisation.
    You can add more tests inside the conditional statement body at any
    stage.

    eg. Test whether pixel coordinate
    (lx-sprite.x,ly-sprite.y)
    of the sprite image is see-thru.

  6. #26
    DCEmu Rookie
    Join Date
    May 2007
    Location
    Under your Bed
    Posts
    168
    Rep Power
    0

    Default

    now im having another problem, but this one might be a bit harder to answer.i have sucessfully gotten the ship to move and shoot, i have a row of 10 aliens which i can shoot and they will dissappear. My problem is getting them all to move correctly. i have tried different methods, but none of them work. I will keep looking for more ways myself, but if any of you know how to do this, all help will be greatly appreciated.

  7. #27
    DCEmu Pro dangee's Avatar
    Join Date
    Feb 2007
    Posts
    531
    Rep Power
    69

    General games

    space invaders...
    dont they kinda shuffle across till you
    shoot the end one , then they all change direction...

    .. or was that the Galaxians

  8. #28

  9. #29
    DCEmu Pro dangee's Avatar
    Join Date
    Feb 2007
    Posts
    531
    Rep Power
    69

    Default

    thx, thats a good model to work from
    but, you'll have to be a little less vague
    about how your
    Invader Attack Block (IAB) object
    aint moving correctly

  10. #30
    DCEmu Rookie
    Join Date
    May 2007
    Location
    Under your Bed
    Posts
    168
    Rep Power
    0

    Default

    ok i decided to stop working on the space invaders(i got bored and i dont know how to do). Now this might sound surprising, but i have decided to work on an Ad-Hoc Messenger. I have found some code that will help me code the ad hoc functions.
    http://forums.qj.net/f-guides-develo...ial-55788.html
    im working on the menu and interface right now, now this is probably an easy question to answer. I working on a keyboard, and i need it to move one square when i push a button, i will explain here is the code i have now.

    if(pad.Buttons & PSP_CTRL_RIGHT && selectorx < 210){
    selectorx += 5;
    }

    this is what i want it to do, BUT i want it so that when i hold in the right button it still only move 5 pixels ONCE, instead of keep moving across the screen.

Page 3 of 6 FirstFirst 123456 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •