Gmoney's Recent Forum Activity

  • Hi.

    On start of layout i want to randomly spawn 1 out of 3 sprites, stay for random 5-10 seconds, then destroy it and instantly spawn again 1 of the 3 sprites an so on.

    I also want ONLY 1 of the 3 sprites to be on screen at any given time.

    Im sure its something very simple but i struggle for 3h now and getting no results.

    Thanks in advance. <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

    Check this example game I made for you, dimitriosfl.

    https://www.dropbox.com/s/vr84dgx18m4fd ... .capx?dl=0

    This is what's happening in the game

    1. There are 3 UFOs; Red, Green and Blue.

    2. Only one of three are randomly spawned in every 3 to 5 seconds upon destruction.

    3. UFOs can be destroyed by Player's plasma projectile or when it goes out of the layout screen.

    4. When you press [Space], you'll be able to shoot a projectile to destroy UFOs.

    5. When a UFO gets hit by the Player's bullet, it will explode.

    6. Player can freely move around on the map but limited to the layout.

    7. Only one UFO will spawn per screen, and the next will spawn only when the previous one gets destroyed.

    Technical explanation

    1. Double click the UFO sprite.

    2. Notice there are 3 animation frames.

    3. Notice animation speed is set to 0.

    4. Frame #1 is Red, Frame #2 is Green and the last frame is Blue.

    5. Go to Event Sheet and look at Line 1.

    6. It says Set Frame - random(3).

    7. This means we're requesting Construct 2 to spawn a random UFO out of 3 possible choices. <img src="{SMILIES_PATH}/icon_mrgreen.gif" alt=":mrgreen:" title="Mr. Green">

  • You're welcome, Scap. Also remember to check out server based game making (using Firebase) threads and tutorials for Construct 2 as well. <img src="{SMILIES_PATH}/icon_mrgreen.gif" alt=":mrgreen:" title="Mr. Green">

    how-do-i-link-multiplayer-with-firebase_t179538

    https://www.scirra.com/tutorials/5015/g ... h-firebase

  • I'm so sorry Gmoney! I've made a mistake! I wasn't very clear to begin with, my fault. So I'm making a retro pixel art game and the environments are made mostly entirely from tilemaps. I forgot the mention that and I thought that the code we'd brainstorm on here would probably be applicable as "On collision with Tilemap" somehow. Obviously, that's not the case here and would need entirely different code taking into account the tilemap . Sorry for your trouble <img src="{SMILIES_PATH}/icon_redface.gif" alt=":oops:" title="Embarrassed">!

    I guess I would need some sort of code that says Creature:On Collision with Tilemap and specifically checks if it's hitting the "side" of an individual tile on the tilemap? Is that something that's possible to do? I think I need to use some sort of bounding box expression to check if the player collides with side wall, yes? I just had a thought but I'm not sure if it'll work. Need to actually try it. I can give the creature an 8 way direction behavior(or platform behavior) and when the creature is left or right from a wall, mirror the animation?

    Oh, no problem at all, heyguy. <img src="{SMILIES_PATH}/icon_mrgreen.gif" alt=":mrgreen:" title="Mr. Green">

    Tilemap can be solid, so it won't be a problem using this code.

    I tested it with a tilemap based wall, and it seems to be working.

    But occasionally the bullet's bounce pattern broke and the object seemed to have bounced around with a mind of its own. <img src="{SMILIES_PATH}/icon_e_confused.gif" alt=":?" title="Confused">

    https://www.dropbox.com/s/x5rktv3kkbt4h ... .capx?dl=0

    I guess I would need some sort of code that says Creature:On Collision with Tilemap and specifically checks if it's hitting the "side" of an individual tile on the tilemap? Is that something that's possible to do? I think I need to use some sort of bounding box expression to check if the player collides with side wall, yes?

    Yes, that's possible 100%.

    Please look into the capx file I made above. The file has two tilemaps; Tilemap and Tilemap2.

    Notice the bounce is only affecting Tilemap2 as per events, meaning the ceiling and the floor can have Tilemap1 with a solid behavior.

    The objects will still bounce, but they'll only turn their faces around when they're hitting the side walls (Tilemap2).

    I can give the creature an 8 way direction behavior(or platform behavior) and when the creature is left or right from a wall, mirror the animation?

    I'll experiment with that as well, because bullet's unpredictable bounce is randomly breaking the bounce patterns.

  • I've tried using WebGL's 'Replace Color', 'Set color' and 'Adjust HSL' effects to change my game object's color settings, but found it's best to just use pre-made image files.

    Also, it seems you need to use an absolute color when modifying WebGL effects. <img src="{SMILIES_PATH}/icon_e_confused.gif" alt=":?" title="Confused">

    viewtopic.php?f=147&t=123505&p=878382

    viewtopic.php?f=146&t=76577&p=633697

    Here's my example on using pre-made image files to change my object's color.

    https://www.dropbox.com/s/bx6m0kg98mpo3 ... .capx?dl=0

  • Yes, because the Localstorage plugin will save data just the way how our usual save games are stored.

    However, if the data is saved locally, they'll disappear once user deletes cache. (I'm not sure if cache is the correct term, but locally saved game files always disappear whenever we go to web browser's privacy section to remove cache and other details.)

    That means the user will have to start from the beginning again, after the local files get wiped out.

    If the game is going to be an epic scale, I would recommend you to store the data remotely on a server, so users can access their saved data no matter what happens to their local save files.

    Setting up a remote save feature will need other things such as finding a good web hosting provider, setting up a database, handling configurations, etc.. though.

    And that's a.. completely different beast. <img src="{SMILIES_PATH}/icon_cry.gif" alt=":cry:" title="Crying or Very Sad">

    https://www.scirra.com/tutorials/4839/c ... sql/page-1

    local-storage-through-mobile-browser_t165787

  • Fixed. <img src="{SMILIES_PATH}/icon_mrgreen.gif" alt=":mrgreen:" title="Mr. Green">

    Now the enemy objects can bounce off and face the correct direction without having to overlap the barriers.

    What I've done was, I've created another object named 'Player' and pinned 'obj_gravity' on it.

    (Oh, I picked a 'Position only' setting for the pin, by the way.)

    Then I made the obj_gravity to face the correct direction upon encountering a situation of 'between 90 and 270' or 'not between 90 and 270' -- of Bullet Angle of Motion.

    This was one tough one to resolve. <img src="{SMILIES_PATH}/icon_mrgreen.gif" alt=":mrgreen:" title="Mr. Green">

    https://www.dropbox.com/s/479t5rl9658vh ... .capx?dl=0

  • This might help.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The star status then must be stored via LocalStorage plug-in.

    https://www.scirra.com/tutorials/1461/h ... age-plugin

    The player won't need to play the levels played previously, nor need to collect all the stars again; even after closing the game and re-opening it later.

  • Fixed.

    I disabled 'PotatoHenchman' -> 'Set Platform Disabled' under Collision event sheet.

    Please remember to enable the Platform behavior for PotatoHenchman on the start of a new game. <img src="{SMILIES_PATH}/icon_mrgreen.gif" alt=":mrgreen:" title="Mr. Green">

    https://www.dropbox.com/s/c7z2vo07l1os0 ... .capx?dl=0

  • That's because the Line of Sight's Cone of View is set to 360. <img src="{SMILIES_PATH}/icon_mrgreen.gif" alt=":mrgreen:" title="Mr. Green">

    I've made an example with a Cone of View of 180.

    https://www.dropbox.com/s/ck98498wwpbqw ... .capx?dl=0

    Please try the following

    1. Jump up to the top of the obstacle and be seen by the enemy with a Cone of View of 180.

    2. Enemy doesn't follow the Player.

    3. Hit the button to change the Cone of View to 360.

    4. Enemy follows the Player.

  • Gmoney Amazing! Thanks for the plug in repository and capx! I downloaded everything I needed and updated them all. Rex Spline is great! This is exactly what I needed. I imagine I can create some sort of Donkey Kong style tram car ride or something similar very easily with this!

    You're always welcome, heyguy. Rexrainbow's Spline will make a great roller coaster or rail system.

  • It seems to be working. <img src="{SMILIES_PATH}/icon_mrgreen.gif" alt=":mrgreen:" title="Mr. Green">

    https://www.dropbox.com/s/fbitk47n9vs85 ... .capx?dl=0

    I found 'mirroring an object via obj_gravity.X > (some X doordinates)' method didn't work, because the object had a bullet behavior.

    So I added barriers to overlap and manually mirror the obj_gravity.. and it worked. <img src="{SMILIES_PATH}/icon_mrgreen.gif" alt=":mrgreen:" title="Mr. Green">

    In a game, I would make those barriers invisible and maybe shrink their width to 1.

    After that I'd line them up against the wall to give players an illusion of flying objects bouncing off the wall, and automatically changing where they're facing.

Gmoney's avatar

Gmoney

Member since 7 Nov, 2015

Twitter
Gmoney has 1 followers

Trophy Case

  • 8-Year Club
  • Email Verified

Progress

9/44
How to earn trophies