Drakkith's Recent Forum Activity

  • Angles are notoriously difficult to work with in my experience, but you can try this:

    Have two instance variables on the pirate ship called "AngleToPlayer" and "DistanceToPlayer"

    Use the following events:

    E.) System: Every Tick: A.) PirateShip: Set Value: AngleToPlayer: "angle(self.x, self.y, player.x, player.y)": A.) Set Value: DistanceToPlayer: "distance(self.x, self.y, player.x, player.y)"

    E.) PirateShip: Compare Instance Variable: DistanceToPlayer is less than X: A.) PirateShip: Rotate Towards Angle: "Self.AngleToPlayer + 90"

    Sub E.) PirateShip: Is Within Angle: 5 degrees of "self.AngleToPlayer + 90": A.) Insert whatever event you need to make the ship fire.

    Note that this makes it so that the ships always fire from one side. You can use the event "is clockwise from angle: self.AngleToPlayer +90" and the inversion of that same event to help you make the pirate ships to turn one way or another. You'll have to change +90 to -90 in some of the earlier events, and +270 if the angle from the pirate ship to the player is less than 90 degrees and you want to fire at the player from the right side of the ship.

  • Create an instance variable called "Direction".

    Then have an event that performs the action on the instance variable "set value" and type in "floor(random(1,9))". This generates a random number between 1 and 9 (not including 9) and then rounds it to the lowest integer, giving you a whole number between 1 and 8 (including both 1 and 8). Then you'll need an event that checks this instance variable and if it is 1 performs the action "simulate control: right" (The 'right' option appears after you select the 'simulate control' action).

    You'll actually need 8 different events with each one checking for a different number. Each event's will then do the "simulate control" action. For the diagonal directions, you'll have 2 actions. For example, if 2 is the number generated, then your event checking to see if the number is 2 will have one action for "Simulation control: right" and another for "simulation control: down", and your object will move down and right.

    An additional action for each event would be to set the animation sprite to a certain frame (or animation) for each number. I don't know the details of your game, so I can't give you a specific way of setting this up. It depends on what the object is doing, when/why it changes direction, etc.

  • Up.

    Can anyone tell me a way to make the character turn to a place immediately and without help control the keyboard. I can continue the work. Please.

    If you are using a sprite for your targeting icon, you can use the action "set angle towards position" and then for the X and Y positions type in "TargetingIcon.x" and "TargetingIcon.y" where "TargetingIcon" is the name of your sprite.

  • Sorry, I don't think I have the ability to post those yet.

  • That looks like it is exactly what I need. Thanks so much!

  • Hey all.

    I've got a problem. I'm using a small, invisible "collision sprite" to guide a larger sprite around and make it bounce off of walls. Since I don't want to have hundreds of these things bouncing all over the place after their larger sprites are destroyed, I put in an event so that when the larger sprite is destroyed the collision sprite is destroyed as well. But the problem is that when the first enemy is killed, ALL of the collision sprites currently on screen are destroyed...

    Obviously this is bad. How might I correct this issue?

    Thanks.

  • I got it to work. Thanks Jobel!

  • Hi Jobel,

    Thanks for the tips. I'll try it out and see how it works.

    Now, time to go look up the details on functions and parameters...

  • Hi all.

    I'm trying to make my game spawn random enemies in a room. My current method is to have a global variable called "EnemyThreatValue" that increases as you progress. Each enemy has an instance variable called "Threat" assigned to them. I want to choose a random enemy, spawn that enemy, deduct "Threat" from "EnemyThreatValue", and repeat as long as "EnemyThreatValue > zero. But for the life of me I can't figure out how to get the program to choose a random enemy. Any tips?

    Thanks.

  • Have you tried r195? We recently fixed a memory leak causing the editor to slow down over time.

    I have not, but I will as soon as I have the time.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Same here after working for a long time with C2, the editor becomes unresponsive and slow.

    I found a workaround though - when I start to feel the UI is getting sluggish, I change the skin/theme, that seems to force a refresh of the widgets and you're good to go for another few hours !

    I'll have to try that. Currently I either wait, or press Ctrl Alt Del and bring up the task manager. I don't actually do anything in the task manager, but bringing it up apparently clears my issue for a few minutes.

  • it could be the intel card as you stated. Can you post what type it is? Also have you tried updating you Gfx card drivers and any other updates for your system?

    Yes, I've tried all of that. I'd love to post what display adapter I have, but I can't seem to find any specific info. Both the control panel and DXDiagnostic just say it's an Intel(R) HD Graphics Family.

Drakkith's avatar

Drakkith

Member since 29 Aug, 2014

None one is following Drakkith yet!

Trophy Case

  • 10-Year Club
  • Email Verified

Progress

11/44
How to earn trophies