theubie's Recent Forum Activity

  • cjuliao

    For sending email, you've got two options.

    If you are running on your own server and have access to php or any other scripting language that has the ability to format and send emails, that is the best way to go. You put all the user info (name, email, person being sent to, their email, etc...) in an ajax call to your server which then will format and send the email. This allows you complete control over what you're sending and doesn't rely on the user having an email client that is configured and working correctly. If you have this option available to you at all, use it.

    If you don't have the above option, you can still pull this off if the circumstances are right. You can use the browser object's "go to url" to go to a "mailto:" string. If the user has a mail client that is configured correctly, it will open it up and start a new email. You can pass all normal email options via a mailto: cc, bcc, subject, body...etc. So you could in theory format a mail message based on text boxes in your game and throw it out there hoping they have a mail client that knows how to hand it. For more info on this, do a google search for "mailto:".

    As for returning...you can use the browser object to get the query and hash from the URL that called the game, so if you sent them the link yourgame.com/index.html you could use the query string to get the name=john%20doe part and parse that into John Doe for use in your game. Or if you wanted to use the hash tag you could use yourgame.com/index.html which would give you the string "brian" for the hash. Either way is a viable way to customize your game based on the URL that called it.

    tl;dr: The browser is your friend.

  • Containers are your friends.

    Put the health bar in a container with the enemy. When an enemy is spawned it will have it's own health bar spawned with it, and any time you pick that enemy it will automatically pick it's health bar.

    Just do a for each and loop through your enemies. Each time it picks an enemy, it will also pick that enemy's health bar so that you're only updating just that one.

    Here is a capx (R120.2) that demonstrates what I am talking about.

  • Do you want it to be a linear (i.e. every 100 points), exponential (i.e 100, 200, 400, 800 points, etc...) increase between power ups or do you want to use a list of values that you personally are picking arbitrary?

    The Mod operator is your friend here...That's the '%' symbol.

    Linear:

    System -> Compare Variable Score > 0

    System -> Compare Variable Score % 100 = 0

    -- System -> Trigger Once While True

    -- (Spawn your power up)

    Exponential is a little more tricky:

    Global Variable -> PowerUp = 1

    System -> Compare Value Score > 0

    System -> Compare Value Score %(PowerUp*100) = 0

    -- System -> Trigger Once While True

    -- System Add to PowerUp 1

    -- (Spawn your power up)

    And picking from a list is even more tricky if you aren't use to arrays.. You'll need an array object (we'll call it PowerUpArray):

    System -> On Layout Start

    --PowerUpArray Push Back 100 on X axis

    --PowerUpArray Push Back 300 on X axis

    --PowerUpArray Push Back 900 on X axis

    --(Repeat until all are in the array

    PowerUpArray -> Contains Score

    -- System -> Trigger Once While True

    -- (Spawn your power up)

  • You already have the right event in place, as long as it's a top level event and not a sub event.

    System -> For Each "Joint"

    Joint -> Is Overlapping "Web" (inverted)

    When that one is run, it will pick all joints that aren't overlapping a web. This will pick no joints unless a web has been destroyed, in which case on the next tick after a web is destroyed the joints that were overlapping it will now no longer be overlapping.

    Here's a capx (R120.2) with just the clean up code in action.

    The use of every tick only applies to running actions every tick. An event that is a top level event does it's check every tick, but if it doesn't evaluate to true then no actions are run. Speed wise, you're not going to take a hit evaluating your event over checking a single variable unless the event is a very complex one.

  • Not sure why you would even need a flag.

    System Compare Web.count <= 0 should be enough to figure out if your clean up needs to run for all joints. If that is true, then run your clean up code. Yes, it check ever tick, true, but your other events will only fire one time and will then be false until you spawn other webs.

    And the others will continue to be false unless a web was destroyed in the previous tick...then will be false again on the next tick.

    Same amount to checks as with a flag without the variable, which IMO is a better practice. Less is more.

  • datomsk669

    My first reaction would be to make it move directly away from the Chaser:

    angle(Chaser.X, Chaser.Y, Chased.X, Chased.Y) + 180 (or -180, both lead to the same angle)

  • silkc2

    You're probably running into something similar to what Ashley stated about objects not being completely created until the tick is completed and started again. I'm assuming that the same probably holds true for the destroy action as well, since I know for a fact that I can still access variables and properties of objects after they are given a destroy action.

    If you pull your clean up events out from under the destroy and make them their own events, they'll work as you expect them to, as they'll check the count every tick, and thus the first tick after the destroy, once everything is actually gone, they'll fire.

  • Your problem with this specific capx is the trigger once events.

    Few tweaks and cleanup resulted in this capx (r120.2)

  • Signatures have to respect BBcodes. Kyatric describes is very well here

  • Pin Behavior

    When you destroy an object, check for any other objects who's PinnedUID which match the UID of the sprite being descriptor and destroy those.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Need more info on how you're dealing with the LoS field. Is it it's own sprite? If so, then you want to use a container

    If you put the sprite you're using for your detection field in a container with the enemy sprite...when a specific field is picked, it will automatically pick the enemy in that container.

    If you're going about it some other way, then you'll need to provide us with a capx or some code to look at.

  • Make the enemy, snowboard and snowboard print all part of a container.

    Container manual entry

    When one object of a container is destroyed, all other objects in the container are destroyed.

theubie's avatar

theubie

Member since 13 Jan, 2013

None one is following theubie yet!

Connect with theubie

Trophy Case

  • 12-Year Club
  • x2
    Coach One of your tutorials has over 1,000 readers
  • Email Verified

Progress

14/44
How to earn trophies