Bullet Hole Problem

GLJ27GLJ27 Member Posts: 27
edited November -1 in Working with GS (Mac)
Can somebody help me please! I am trying to make a duck shoot game like what you would see at a carnival but I am trying to make it where you shoot and if you miss it would create a bullet hole on the background items like the water or the backboard. The problem is when I shoot the duck a bullet hole appears where the duck was how do I make it not do that?

Comments

  • wouterwouter Member Posts: 174
    you must do by the wall (background) if collapse, and not by the duck?
    so if attribute bullet collapse with duck then change image (dead duck)
    and if attribute bullet collapse with background then change image (bullet hole)

    i guess this is must work?
  • GLJ27GLJ27 Member Posts: 27
    That didnt work. My game is set up so you have a fire button and crosshairs. So here's my code.

    fire button
    when actor receives touch
    change attribute game.fire to 1
    after 0.1 seconds change game.fire to 0

    crosshairs
    (you move them around with your fingers)
    if attribute game.fire = 1
    spawn actor bullethole

    duck
    when actor collides with crosshairs and attribute game.fire = 1
    after 0.1 sec. destroy this actor

    bullethole
    when actor collides with duck
    destroy this actor

    so it all works and when you shoot the duck the duck and bullet hole disappear which is what I want but then if you shoot and miss and then a duck passes over the bullet hole the duck will the delete it how do you stop it from doing that?
  • wouterwouter Member Posts: 174
    bullethole
    when actor collides with duck
    destroy this actor

    must be:
    when actor collides with duck and game.fire = 1

    only if you fire and another duck move over a bullet hole then he's also destroyed...

    i should do:
    not use the bullet hole to destroy the duck but the crosshairs;) so if crosshairs collides with duck and game.fire-=1 duck id destroyed!!!

    that must work;)

    wouter
  • wouterwouter Member Posts: 174
    crosshairs:
    when game.fire=1
    if {
    crosshairs collides duck, destroy
    }
    else (otherwise){
    spawn bullet hole
    }
  • GLJ27GLJ27 Member Posts: 27
    Great! Got it to work perfectly! Thanks! Now I just need the bullet hole to be behind the duck so when the duck passes over the bullet hole it isnt on top of the duck, do you know how that can be done?
  • wouterwouter Member Posts: 174
    sorry for the late answer (sleeping and working;)
    http://gamesalad.com/wiki/how_tos:multilayermovement

    wouter
  • GLJ27GLJ27 Member Posts: 27
    Yeah I know you mean. Thanks man, I haven't got a chance to try that technique yet, I've been trying to fix a different problem I have been having with bullet hole. The problem I've been having is that there are 3 different types of bullet holes (small, medium, large) and I have 3 objects I want the bullet holes to spawn on (background, a rock, and the water) so I have it setup so if the bullet hole collides with the background I have it spawn the small bullet hole and destroy itself and it works and did the same thing for the rock except it spawns the medium bullet hole and it works 2 but for the water I have it spawn the large bullet but it always spawns either the small or medium and never the large. Do you know how to fix this?
  • wouterwouter Member Posts: 174
    what code do you use to make the small and medium holes?

    what i think:

    if crosshairs collides with background then spawn bullet hole actor small
    if crosshairs collides with rock then spawn bullet hole actor medium
    if crosshairs collides with water then spawn bullet hole actor big

    wouter
  • GLJ27GLJ27 Member Posts: 27
    Wow yeah that worked perfectly. Why i didn't think up with that. Thanks man you have really helped me out.
  • wouterwouter Member Posts: 174
    haha no problem;)
Sign In or Register to comment.