gamecherry's Forum Posts

  • Hello all and thanks for looking.

    Im trying to lob an object with a parabola like a grenade does. Using angle of two points is resulting in the object moving in a straight line. I tried angleLerp but with no success. Does anyone know how to do this? Thanks again

  • Now I feel like an idiot. Turns out just pinning a segment makes all segments of that type fall in line. Exactly like the pin/rope example I didnt bother to look at first. Sorry to waste your time.

  • For clarification, Im not making a Snake game. Im trying to make a snake like object like youd find in a Contra or Metal Slug game. Sometimes its an actual snake, often its an arm or something.

    I got it to work by using the Pin behavior - If 3 segments made the snake as C (tail) B (body) A (head), Pin C to B and Pin B to A and give A directional behavior to "drive" the body segments (B,C)

    Now, Im at a loss on how to pin the same segments of the body together, for example; C,B,B,B,A Any ideas?

    Thanks

  • Hey all, I have a question that Im not sure even how to word. Do you know how in games a snake would be represented as balls or separate pieces to make it move? How is that done? How would that be done in C2?

    Thank you for looking.

  • Thanks for the reply Sup. Yeah, Im worried about performance and possibly incompatibility issues with mobile as 7 layers just seemed to me to be overkill and to get it to look correct I'd have to add an 8th layer for my floor texture so as not to occlude the parallaxing objects. Im going to try the suggestion you gave and if it comes out wonky I'll just use the 8 layers. Thanks so much for your reply.

  • Hello and thanks for looking,

    Im making a game with several objects parallaxing in the backgrounds resulting in me using 7 layers. I'd rather not use that many. Is there a way to move the objects according to the scroll speed so I can put them all on one layer?

    I have scrollX following a camera which is lerping the main character so the screen only scrolls when the camera/character reaches an X threshhold - how would I go about making the objects scroll with the camera?

    Thanks

  • Plinkie, yeah, it works great as a rotational turret- perfect even. I was hoping I could use it in other ways but doing it manually isnt a problem. Thanks again.

  • Plinkie, I thought the same thing but I couldnt get it to fire no matter where I stood.

    Thanks Plinkie and Roach for taking the time. I scrapped trying to get it to work with turret and just did it all manually.

  • I would think that with the option to turn rotation off that it's not necessary to have it on to work.

  • Hello and thanks for looking,

    Im having trouble getting a turret behavior object to shoot with rotation turned off. Anyone know why or how to remedy it?

    If rotation is turned on, it produces a projectile and fires it but with it turned off, the object just sits there and does nothing.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hello all and thanks for looking.

    Im trying to get the bumpmapping effect to work with my game and am having little luck. Im hoping one of you knows how it works.

    When I set bumpmapping Light coX to ((character.X-bumpmap.X)/bumpmap.Width)*100

    and bumpmap Light coY to ((character.Y-bumpmap.Y)/bumpmap.Height)*100

    The Light (in the bumpmap) is floaty and not accurate which can be fixed by adjusting the coordinates but as soon as I overlap another bumpmap its back to being not accurate. Is this because the origin of "light" in the bumpmap is reset with each bumpmap? And is that origin at the bottom of the bumpmap or the bottom of the layout? Im so confused.

    EDIT

    Even if I combine my 2 bumpmaps into one very large bumpmap, the light coordinates are still floaty and drifting. Im assuming then that there's a problem with the equation ((character.Y-bumpmap.Y)/bumpmap.Height)*100

    The bumpmap parameters operate on a 1-100 scale, I guess a percentage of the coverage with 1 being first pixel of the bumpmap, 50 the middle pixel, and 100 the last pixel. I think the equation is missing something and thats allowing the light to drift. Anyone have any ideas? Am I even making sense?

  • Hello and thanks for looking

    I have a car that shoots a missile at other cars. The problem Im having is the missile drifts off course the more I speed up the car. E.g. When stopped and pointing at a 45 degree angle the missile does what it's supposed to - it moves at an angle of 45 degrees. If driving slowly it still behaves properly but when the car is travelling at high speed the missile drifts the faster the car moves.

    Is there anyway to mitigate this?

    Im spawning the missile with bullet behavior as such (the animation allows for 24 frames at 15 degrees each);

    set bullet angle of motion to angle -->((((carBlock.AnimationFrame*15)+360)%360)/15)*(15)

    Thanks for your time.

  • You could do this:

    global number index =0
    
    +------------------------------+
    | while                        | set index to int(random(5,8))
    +------------------------------+
       +---------------------------+
       | array: value at index <99 | array: set at index to 5
       |                           | stop loop
       +---------------------------+[/code:10wrpefu]
    Basically pick a random index until the value isn't 99 before setting the value.
    

    Wow! Thank you so much R0J0hound. I incorporated that into my code and applied it to picking the 99s, the 5s, and some other things that I had yet to figure out when I posted and it works great. Those 2 lines of code relieved so much stress and Im grateful.

    Thank you R0J0hound and everyone else for taking an interest in helping me.

  • It might be worth asking what are you using the array for ? Ive ran into trouble when I was using the wrong thing for a specific instance.

    Thank you for your interest. I'm trying to populate a map with icons. The icon(s) are a single animation of 6 frames at 0 fps. I need the icons to be placed with a random frame 1-4. Within this map some of the icons need to be set at frame 5 (according to what group I assigned them to.) Some of them need to not exist, which is where the 99 value comes from (values of 99 are not instantiated onto the map.)

    I want to set all X elements to a random number between 0 and 4. Then I want to set some elements to 99. Then I want to set some of them to 5 but not the ones I already to set 99.

    I know, it's convoluted and obtuse.

    I figured the best way to do this is to set up an array to hold the frame numbers for each icon so, I can save their location and frame number when exiting and entering the map.

  • Hello and thanks for looking,

    I wasn't sure how to word the topic, apologies for that. I'm trying to assign all the X values in an array to a random number between 0 and 4, which I did using 'For Each X Element--> Set Value At Array.CurX to int(Random(0,5))' This seems to work.

    Now I need to figure out how to set some of them to 99 based on groupings I had set earlier. I.E. 'Array-->Set Value at int(random(2,5)) to 99, Set Value at int(random(5,8)) to 99, etc....' This also seems to work.

    The hurdle has become, how do I now set an element within those same groupings to 5 without changing a value that was previously set to 99?

    If this doesn't make any sense please, let me know and I'll try to clarify. Thank you for your time.

    Admittedly, Im kind of an idiot when it comes to math and math concepts. Here is a graphic depicting what Im trying to do.