Create Object vs Spawn Object [SOLVED]

0 favourites
  • 9 posts
From the Asset Store
Fully commented source code/event sheet & sprites to create a space shooter game
  • Err, having problem with my spaceship shots here. Recoding new version.

    Originally they followed rotating ship no problem, matching angle etc w bullet behaviour.

    In new version, I'm using Create Object though and can't figure out how to make the shots match the player ship angle.

    They do weird things if u set angle to player ship, etc. Pinning does not work.

    Not sure what I'm doing wrong. Think I would rather use Create Object for shot spawning due to position offset possibilities vs just Spawning Object at image point?

    Edit: You can actually do position offset it seems from the imagepoint also with a variable, but it only does a Y offset if you do a -value? Looking for X offsets.

  • We cannot diagnose "weird things". Post an example, or be more specific.

    When talking about angles, the most obvious thing is that the default "forward" angle faces right in the image editor, it is a common mistake to have your projectiles facing up. Otherwise, if you're talking about offsets, your origin imagepoint probably isn't in the right place.

    If these don't solve your problem, post an example to get better help.

  • Duh. I always post a capx if noone replies.

    No reason to be so rude and trollish. If I recall, you always do this and you're always wrong.

    And it was very specific. Anybody who's familiar with this would be able to diagnose this in seconds.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Ok, here's the capx.

    (Please ignore web site. It's very temporary. Not a plug or anything.)

    http://www.darksunpictures.com/public/Layouts.zip

    Basically trying to make the shots follow ship (square here).

    You can click/touch anywhere to rotate ship.

    Think I have to use Create Object as opposed to Spawn Object as trying to position the shots with offsets versus player ship position and I have some randomization involved.

    This is very easy with Spawn Object, but it uses image points and an offset versus image point seems to work only in the Y?

    Any help greatly appreciated.

  • Duh. I always post a capx if noone replies.

    No reason to be so rude and trollish. If I recall, you always do this and you're always wrong.

    And it was very specific. Anybody who's familiar with this would be able to diagnose this in seconds.

    Suit yourself then.

  • EDIT: I think I solved this. I think I could do this with Spawn Object and a lot of different image points. It's an inelegant solution and it will bloat the code a little, but it should work. On the other hand, if there's a quick way to do it with Create Object, that's a functionality that should be programmed in because there you have the X and Y coordinates and you could do quick position randomization offsets via a variable. Plus it requires a lot of work from the user for what should be just a quick variable fix.

  • http://www.blackhornettechnologies.com/Construct2Stuff/layouts_BHT.capx

    Tweaked a few things but setting the angle to the player seems OK.

  • Dude, you are my God.

    I will shower you with CGI items when any of the Dark Sun games come out.

    I was about to start work on the slow and tedious version.

    So glad I checked one last time.

    Believe it or not I tried the exact same thing and it wasn't working at all. It was making existing shots turn and other weird things.

    Admittedly, my shot code was a lot more complex, so I had a lot more stuff going on over there.

    Also, I was using a much older version of Construct 2.

    But great to know this works! Will save me an unbelievable amount of work.

    Cheers!!!

  • Ashley

    If you go the image point route or even the variable route, there seems to be compression (ignoring of some image points/variable offsets) when you reach 90 and 270 degree rotation. When you think about it, it sort of makes sense because then an x offset should be a y offset, but with image points it should work and it doesn't or maybe it should be programmed in for both methods? I found a way around it.

    Has anyone found a way to make the object continue rotating after just a tap to that position? Not sure how to program that in. Tried various things but it screws up other programming. So far the way that capx I designed is posted the square will only continue rotating to the clicked/touched point when you hold it.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)