InDWrekt's Recent Forum Activity

  • As a bonus, I decided to include another capx that shows another way to do the same thing. This method only uses 1 event for changing between the 2 directions but, it is much more difficult to read. It uses 2 animations for showing the different directions instead of mirroring the Sprite. Then uses a ternary operation (look it up on Google if you don't know what that is) to decide which animation to show.

    This is a more advanced method that can cut down your event count, but can be a nightmare to upkeep if you ever have to go back and fix it. That is unless you have a good grasp on what a ternary operator is and how it works.

  • Attached is a capx example for you.

    All I did was add an event for when the Sprite reached the end of the sine magnitude - 1 which mirrored the Sprite object.

    I hope that gets you what you need and good luck with your project.

  • My question is, why are you using the 8 direction movement if you don't really want the functionality of 8 direction movement. It sounds to me like you could just use an event for the left and right arrows. This shouldn't really change your event list too much and would give much more options.

  • Ok, here is a capx with the type of movement I believe you are looking for.

    From what I read, it looks like the problem with how you have it set up is, the event "is overlapping background". This is always true if the sprite is overlapping the background and will always run (even if the background is behind the goal and the sprite is only touching the goal, if the background is behind the goal, it is still overlapping the background).

    I use an else to test if not overlapping the goal. Also, I don't know how much his helps, but I think you should initialize all instance variables in a for each block. I did so in my capx for you.

    Good luck with your project.

  • [Edit]

    Apparently, i didn't read all the way through the post well enough. The answer I gave was not really what you were looking for I have removed it.

  • Just wanted to say, it looks good. I Also think it would play better with a different control scheme. The mouse aim would be nice, but it it could also work well with asteroid type movement where pressing the arrow keys turns the player by a few degrees and pressing up or down makes the ship fly in that direction.

  • To get your game on Google play, you need to set up a developers account. Log into your Google account and go to:

    https://play.google.com/apps/publish/

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • In the Layout properties, select the event sheet you want the layout to use.

    [attachment=0:3b1o31x8][/attachment:3b1o31x8]

    All you have to do is select the layout and the properties dialog shows the settings used by the layout.

  • Also, you can combine your click and touch events by placing them in an or block. This will cut down the total number of events you will use by half.

  • Set the second condition in each sub event to an else condition. The way you have it set right now, the sub events trigger consecutively meaning, as soon as you set the value"nuke" and "spawn", the second condition is always true.

    Just to be clear, the 2 conditions "Commander.controlmode = 'nuke'" and "Commander.controlmode = 'spawn'" should be changed so it is just an Else event. This means when the condition before it is not true this condition is true.

  • OK, so I took some time to modify your project and add what I had suggested. To be honest, I don't completely follow all of your logic, so I didn't do any optimizations like I usually would. I did however, have to move around a few events to get it working. Take a look at the changes and test it out. You may be able to run with it and make it much more streamlined with your methods.

    As for your question... Yes, you can combine and/or logic in 1 event. Take a look at event 5. I embedded a simple if/else statement to a set of conditions and wrapped them with an or block. If you don't understand the statement, do a search for "ternary operator" without the quotes. This is a common programming operation and can be used in Construct to simplify a set of if/else events into a single event. Simply put, the first condition says:

    if Pos1X equals Pos2X and Pos1Y does not equal Pos2Y then return "True" if not return "False"

    The value returned is then tested against the "True" string in the first value. There are many other ways this could have been accomplished but, I have been on a ternary operator kick in my examples lately, so that is what you get.

    I hope that clears things up for you and good luck with your project.

  • I'm getting the same issue when using Chrome. In Firefox, it worked for me though, did you try using another browser?

    BTW, I got a kick out of all the different "death" animations. It's pretty funny. Are you supposed to be able to jump mid air over and over again? I played an entire game where I just tried to see if there was a limit to the number of times I could jump in the air without touching the ground and made it like 10 times before running into a speaker.

InDWrekt's avatar

InDWrekt

Member since 19 Sep, 2011

Twitter
InDWrekt has 7 followers

Trophy Case

  • 14-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

19/44
How to earn trophies