R0J0hound's Forum Posts

  • BlueSkies

    Yeah it's the same way to access pixels.

    Logomachine

    Physics would work in concept, but in practice it would be much too slow. A manual per-pixel motion as you describe would be a bit faster, but you'd need to implement most of it in js to get a useable speed.

  • In a simple case the general score could just be the sum of the scores.

    a+b+c+d

    You can further tweak that to give some scores priority over others like:

    4*a+3*b+2*c+d

    which would give the "a" score the highest priority.

    It can be more finely adjusted to adjust the priorities of the scores. You could even pick the factors at random to get a unique ai.

    I suppose you could use any arbitrary formula to combine the scores into one value as well, but probably simpler is better.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It's a limitation of sorts. A forum search of "top level event" should give some topics about this.

    Basically event 1 is a top level event, and event 2 is a sub event.

    When you create and object it becomes the only picked object of that type. However it isn't added to the sprite list yet.

    I think I explain it better in another post

    Say there are 3 sprites, with uid's 1,2 and 3.

    When event 1 starts c2 internally has these three lists.

    Sprite 1,2,3

    Picked 1,2,3

    New empty

    So an object is created with uid of say 4 and at the beginning of event 2 the lists are as follows:

    Sprite 1,2,3

    Picked 4

    New 4

    Notice the new object isn't added to the sprite list yet.

    In event 2 the "pick all" condition only picks everything in the sprite list, so the result is:

    Sprite 1,2,3

    Picked 1,2,3

    New 4

    Finally after event 2 there are no more sub events of event 1 so this is a top level event and the new list is merged with the sprite list.

    Sprite 1,2,3,4

    Picked 1,2,3,4

    New empty

    Anyway there are a few ways to deal with this.

    One I've used is to just create the objects in one start of layout and effect the sprites in a second one:

    Start of layout

    --- create sprite

    Start of layout

    --- sprite: set opacity

    Another way could be to do your events as you have it but modify the new object as you create it and use pick all to affect the existing objects.

  • Ah, I was hoping there was more to it. Last I looked I couldn't find any issues with the code at that line and I haven't been able to reproduce it.

  • heliogame

    "angle()" is an expression so I mean using the expression

    angle(0,0,self.vx,self.vy) [/code:3yxzni2q] when setting the angle.  Also I didn't mean using the bullet behavior.  "bullet" was just the object name I used.
  • I don't think regex is suited for that. A better way would be to add each number to a dictionary to eliminate duplicates. for example:

    global string list1= "112, 113, 112, 114, 113, 112,"

    global string list2=""

    repeat tokencount(list, ",") times

    --- Dictionary: add key tokenat(list, loopindex, ",") with value 0

    dictionary: for each key

    --- add Dictionary.CurrentKey&"," to list2

  • If I enjoyed doing it (which I did), then it was time well spent.

  • You can find a equation by googling the distance between a line and a point.

    If a and b are the two points of the diagonal and p is the other point then the distance from p to the line would be:

    Abs(((P.x-a.x)*(b.y-a.y)-(p.y-a.y)*(b.x-a.x))/distance(a.x,a.y,b.x,b.y))

    Edit:

    Oops you wanted y distance, that would be this:

    Abs(Lerp(a.y, b.y, (P.x-a.x)/(b.x-a.x))-p.y)

  • jobel

    With 8 instead of 4, then with one ray it would do twice as many intersection tests.

    In general if there is no culling, the number of intersection test will equal=

    (number of rays) * (number of image points)

    So if you increase either then the amount of time will increase proportionally.

  • Yes you can, it becomes much simpler to do physics when it's just in a line like that.

    The motion is simple: increase the speed with gravity and move down with the speed.

    Collision detection is done by looping over the blocks from the bottom up. If the current block overlaps the block below push it up and set it's speed to the speed of the block below ...and repeat.

    https://dl.dropboxusercontent.com/u/542 ... olumn.capx

    ps. the speed change isn't physically correct when the objects collide. The actual speed of both blocks after a collision should be the average of the speeds, but it would add some complexity to the events.

  • looking at it again you'll probably want width>400 since by subtracting from the width it should be shrinking.

  • Repeat 1 means the animation is played once. I tested using 0 instead and it's the same, so it would seem 1 is the minimum number of times an animation will play thru.

  • For that simple case, yes.

  • Use max() and it will stop exactly at 400.

    +-------------------+
    | sprite: width<400 | sprite: set width to max(400, self.width-10*60*dt)
    +-------------------+[/code:2ox87p20]
    
    If the value is increasing instead you can use min().
  • Google is in the business of collecting data. Data from everywhere it can get it's hands on, and as much as possible. In a similar fashion to this latest privacy violation, a few years back google got it's hand slapped for using it's street view cars to also collect data off of unsecured wireless networks. I don't know what their intentions were, but there's no reason for them to have it. They probably don't even know what to do with it yet. They'll figure that out later.

    That is just them taking information from us without our permission. Google already gets lots of data from us whenever we use it's products. They get data and we get services in return. After they get the data they analyze it.

    For some known examples:

    If you use google search they know your search habits and interests. Why? Well, to show you ads that appeal to you is one reason.

    If you have an android phone and you use google maps they know where you are and where you go. One use of that is so google maps can have an idea of the traffic speed and find a faster route around slow areas.

    Why they would want to listen in on you at you pc? Don't know, but they also has all sorts of data from you that we trust them not to inspect. Gmail is one example. Laws keep them from using some data, and even forbids even collecting it, but that doesn't mean they don't have it somewhere.

    Too bad this whole data collection is becoming more and more common. Governments do it, but lack the efficiency that a private company can have. Even Facebook, Apple and Microsoft are data collectors. We aren't as anonymous as we once were.