Peej42's Forum Posts

  • I was thinking the way I've coded it is wrong.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yeah, I saw that while searching for a solution.

    I'll be honest, I didn't understand it completely.

    I realised, shortly after posting my question that my game plan probably wont work anyway.

    Thinking out loud....

    If i add red-100,0,0

    to blue-0,0,100

    I get magenta.

    Theres no other combinations left other than adding green to magenta, giving white.

    All values will be 100 and the game technically over.

    I wanted to keep combining coloures, creating many different ones!!

    What can I do?

  • Hi guys.

    As the title suggests, I'm trying to find a way to stop two added values from going over a certain limit within the formula. Something like:

    a+b=(not to go over 100)

    Is it possible?

    I'm basically trying to add RGB values together to create RGB mixes using 'tint'. So if I add:

    Red=100,0,0

    Blue=0,0,100

    I get magenta: 100,0,100.

    Further down the line I envisage the numbers being mixed totalling more than 100!

  • Yeah, I can't get it to work.

    As I understand it there's also a slightly hidden command: loopindex("name of loop") but that doesn't work either.

    I tried: loopindex("x")

  • You've been a great help so far with my efforts so I hoped someone could answer my next question:

    When running through an array with For Each X Element, does loop index not work?

    Cheers

  • Hello again.

    Could someone please help me out.

    I have a bunch of different coloured blocks on the screen, each block has the variable "Name".

    So I have ORANGE, BLUE, YELLOW, RED, GREEN.

    Each block is part of the family "Blocks"

    What I need to be able to do is pick out the block "named" say, RED from a bunch of other blocks and move it. How do I go about picking the RED block?

    I've tried:

    SYSTEM>Pick Blocks where Block.Name = "Red" > (Action>) Blocks>Set position (190,150)

    But that resulted in moving ALL the blocks from the family to 190,150!

    Cheers.

  • Hi guys.

    How to I use 'accelerate towards point' effectively?

    I have my object accelerating towards the point I desire but the object then overshoots the point and continues past!

    How can I control when the point is reached?

  • Thanks for the reply Justifun.

    I got quite far since posting my original question and I have the names of my objects stored in an array quite nicely.

    So, I have something like this:

    0,red,yellow,blue

    red,0,0,0

    yellow,0,0,0

    blue,0,0,0

    As you can see, it's basically a grid with names across the top and down the side.

    What I wanted to do next.... which I can't figure out, is cross reference the grid.

    I wanna be able to look along the X axis (Red) then down the Y axis (Yellow) and were the two meet up, set to orange! Then the same with X=Yellow, Y=Red....

    Then, later on, I want to be able to do the same thing with looking up where the X and Y meet and have it result in 'orange'. You get what I mean, I'm sure.

    Where the X=red and the Y=blue, that would be purple and so forth.

    I hope you can help as I'm quite stuck on this part.

    Cheers.

  • How do I: Store the NAME of objects onscreen to an array?

    I have 3 objects on screen (for now). They're all in the same family.

    How do I code a system that goes through the objects 1 by 1 and saves their NAME(s) to a 3 by 3 array, at position X=0 for each?

  • Again... I figured it out.

    A function was a bad idea AND I've even got multiple guys moving about.

    All this I've learned in a matter of hours.

    Construct 2 is mighty fine.

  • I'm confused again.

    I'm learning so much bit by bit but something's gone wrong.

    I've got all the actions as before, in a function.

    I have the call from the function to choose (1,2,3,4,5,6,7,8,9) as mentioned before.

    The little character mirrors perfectly,

    But he's stopped moving!!! The direction simulate etc. lines have ceased to work!

    What's gone wrong.

    I even added a line after the Direction Simulate line in each action, to set x to 10, x to 20, x to 30, x to 40 etc.... and they all worked. He skipped to 10,20,30,40, etc.

    But he doesn't just move like he did.

    Any ideas? (I'd hate to think the little guy was just moving 1 pixel on each call!)

  • I think that may well do the trick.

    Thanks a lot for the help.

  • That worked brilliantly, thank you.

    Tell me.... is it possible to do all that from with a function of some sort.

    I mean, one standardised movement method, rather than having to copy 8+ events over and over for each version of the chap sprite?

    As I said earlier, I plan to have lots of these sprite mulling around but with different appearances, therefore different sprites.

  • Well, that did the basics for the movement that I was after, but how do I have it so I don't have to press the arrow keys to have the guy move?

    I want the little chap to move about by himself randomly.

    Thanks for the reply, by the way. Much appreciated.

  • This is a little embarrassing but I'm a bit stuck.

    I'm very new to Construct and I'm finding the things that should be hard, easy to do... and the things that should be easy, hard to figure out!

    Basically, I have this little block character on screen. He's a simple little chap, that only faces left or right.

    I'm trying to figure out how to give the guy the ability to move in all 8 directions but to only face left or right while doing so.

    I want him to do this in a random fashion, like he's just wandering around the screen.

    How can I go about it?

    (Eventually, I plan to have lots of these characters (all different colours) wondering about - do I have to program each separately, or is there a built in behaviour clone feature that I've yet to discover?)

    Many thanks for your time.