using an analog to control a moving actor (template in exchange of title screen artwork)

digitalzerodigitalzero Member, BASIC Posts: 639

i have a game in which i am able to move the actor left or right and able to move its laser with an analog to control the laser on the moving actor... you can see what im kind of talking about here http://forums.gamesalad.com/discussion/74105/rotating-on-a-moving-actor#latest

so here is the rules i have placed on my laser actor

constrain attribute:
self.rotation to game.controller rotation

constrain attribute:
self.position.x to 95*cos(game.controller rotation)+game.players x

constrain attribute:
self.position.y to 95*sin(game.controller rotation)+game.players y

NOW THE PROBLEM IS!!!! when the actor moves because i have the actor at a constant speed the rotating actor is moving up for some reason... away from the actor its FRUSTRATING!!! can someone help me please

by the way i just have a constrain behavior on the actor... the x and y position and a motion linear velocity x to 20... you know, simple !@#$% lol.

Comments

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880

    Perhaps this will give you some ideas.

  • digitalzerodigitalzero Member, BASIC Posts: 639

    this is pretty much what i was looking for @rthurman... however there are some troubleshooting problems with it... for some reason when i press the right or left button and toggle between the two sometimes the actor will not move... by the way @rthurman would you like to collaborate on a project and what would you like for your title screen for one of your games?

  • digitalzerodigitalzero Member, BASIC Posts: 639

    oh another thing.... i changed the left and right buttons to left and right on the keyboard

  • digitalzerodigitalzero Member, BASIC Posts: 639

    and the laser actor... i see that its a full laser but you only have it visible half way... idk if im explaining that right or not... the laser will be able to zap enemies... will it still work for that half of the actor or is it for the full actor... only asking this because im making a collide behavior

  • SocksSocks London, UK.Member Posts: 12,822

    @digitalzero said:
    and the laser actor... i see that its a full laser but you only have it visible half way... idk if im explaining that right or not... the laser will be able to zap enemies... will it still work for that half of the actor or is it for the full actor... only asking this because im making a collide behavior

    The half-image trick is the most straightforward way to achieve this kind of thing - I use it all the time as even with the 2x larger (longer) image it is still more efficient that the alternative - which is three constrain behaviours - the only downside is that the whole length of the actor collides, even the invisible bit, if this is an issue you will probably need to take the trigonometry route, I've attached a couple of modifications to @rthurman 's file . . . .

    Link:

    https://www.mediafire.com/?9juih6bbjx5cllr

  • SocksSocks London, UK.Member Posts: 12,822

    @RThurman said:
    Perhaps this will give you some ideas.

    Weird, I've been locked into this idea that analog controllers must necessarily have a main area element and a 'joy stick' actor that you move around, I've never thought of simply having an area that you drag your mouse around it, really simple and very neat, consider the idea stolen. :)

  • digitalzerodigitalzero Member, BASIC Posts: 639

    @socks for some reason its not allowing me to open up your file on gs... i just installed the update because i thought thats where the problem lied but its still not working

  • digitalzerodigitalzero Member, BASIC Posts: 639
    edited November 2014

    ...

Sign In or Register to comment.