thatjoshguy's Forum Posts

  • UPDATE: Enemies now patrol way points, and will return to patrol if they lose sight of you after a while.

  • no problem, glad I could help. I'm jsut starting out, and the forums have been a wealth of information!

  • Okay, so I'm kind of nervous posting this as it is still pretty early and this is a first attempt in C2, but I'm finally starting to nail down some of the gameplay elements so I thought I'd share.

    Click here to play: SR:OPS Demo

    <img src="http://www.thatjoshguy.com/wp-content/uploads/2013/05/Capture1.jpg" border="0">

    <img src="http://www.thatjoshguy.com/wp-content/uploads/2013/05/Capture2.jpg" border="0">

    <img src="http://www.thatjoshguy.com/wp-content/uploads/2013/05/Capture3.jpg" border="0">

    <img src="http://www.thatjoshguy.com/wp-content/uploads/2013/05/Capture4.jpg" border="0">

    SR:OPS started out as a basic top-down shooter, but after figuring out some groovy lighting (Flashlight with dynamic shadows! W00T!) effects and making them core gameplay mechanics, I decided to lean more towards a stealth game.

    I'm interested in everyone's opinions so far, as well as how well it performs for you. I'm developing/testing on a rather low-end PC and I get a pretty solid 30+ frames a second, which is acceptable for this game, but I worry about it dropping too low later on.

  • holy heck, turns out you CAN do that...

    super simple code!

    Event: "Enemies"|is overlapping "Enemies"

    Enemies Action: Move "-1" pixels at angle "angle(Enemies(0).X, Enemies(0).Y, Enemies(1).X, Enemies(1).Y)"

    Edit: no, don't do that... it seems to make things worse. I really don't know, the first way I did it seemed to work the best

  • the downside of this approach is you would need to do this with each enemy type in the family.

    If there's a way to choose the object in C2 within the family, I don't know it. It would be awesome to do something like angle(enemy(1).x,enemy(1).y, enemy(2).x, enemy(2).y)

  • In my code I reference the instance against the family. ZOMBIE is in family ENEMIES, so when I write the code to move them off of each other I move the ZOMBIE -1 pixel, not the ENEMY.

    Don't have time for an example capx right now, but here's a screencap of what it looks like in my code, if that helps:

    http://thatjoshguy.com/example.JPG

  • Here's what I do: I have my enemies in a family, then I create an event for each enemy type. For example, if one enemy type is "Zombie", and the family is called "Enemies":

    Event: "Zombie"|is overlapping "Enemies"

    Action: Move "-1" pixels at angle "angle(zombie.X, zombie.Y, enemies.X, enemies.Y)"

    there may be an easier way to do this as far as referencing the family member within the family, but this works rather well. It just takes the angle between one sprite and the other, and moves on of the back pixel until they no longer overlap. This creates a smooth effect when many sprites are trying to hold the same position

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I just ran into this, and can confirm on Win 7 x64 bit, dual monitor. Making sure the "select" tool was not chosen as mentioned by firebelly corrected the issue

  • make sure you are escaping characters. When sending events, I had to format my event data as a JSON string, so it would end up looking like:

    "{"""x""":""&xvar&"","""y""":""&yvar&""}"

    or something like that.

  • Thanks for the tip, I'll try that. Honestly I may like that more anyway, as I want to play with the event data a bit and if I can do that outside of C2 then even better. Don't get me wrong, I like C2 - but sometimes I just wish you could break out into code!

  • Correction: the above does not fix the issue, it just causes the event to only fire once. If i can get an example together with a public server I'll toss it up here

  • I'm not using "on any event" - I'm using "on event recieved" with a named event, i.e. "playerUpdate". When the playerUpdate event is fired from the server, C2 reacts with its event over and over again vs. firing once per event.

    I seem to be able to get around this if I set up my C2 events as:

    • -> Socket| on "playerUpdate" recieved || Socket|Split Data Received
      • -> Socket| Is Data Available? || (do my actions here)

    ...but this seems to be quite a few extra steps. Why can't I just call my events directly after "on "whatever" recieved?

  • question about this plugin: when i use the "on event recieved" event, which ever action I have used it for gets spammed. For example, if my servers sends event "newPlayer", and in my game code I tell it to create a new sprite, it creates a new sprite every tick even though the event is only fired on the server once. I'm using the latest beta C2.

  • Would it be possible to add a "fill path with gradient" command to this plugin?

  • Hate to revive an old thread, but as I was looking to do the same thing this may help others:

    I found simple way to do this based on the discussion in this thread:

    scirra.com/forum/black-hole-physics_topic41431.html

    I simply added a click event on my "bomb", with an "apply impulse towards position" action on my crates using this formula:

    Impulse: -bombForce/distance(bomb.X,bomb.Y,crate.X,crate.y)^2
    X: bomb.X
    Y: bomb.Y
    Image point: 0
    

    where "bombForce" is a variable that can be adjusted to suit your needs (I used 250). Works a treat!