AllanR's Recent Forum Activity

  • jobel

    I did that version a few weeks ago when someone was trying to make a large universe... so I thought I would try to make a system that was infinite but could have different space regions ready to scroll on to the screen based on where you were.

    that is why I added the Z key to zoom out, and the C key to show solid colors so he could see how the tiles rotated under you...

  • You do not have permission to view this post

  • jobel

    I was working on a sample when oosyrag and newt made their suggestions - and came up with something very similar.

    I dont remember a spaceship behavior, but my sample works the way I think a spaceship should without any shake at max speed...

    https://www.rieperts.com/games/forum/spacebackground2.capx

  • jogibaer5000

    event 4 refers to all instances. so they all will add 2 to their Y position.

    if you want to have them move in different directions, you have to decide what the rules are for their movement, and then set up a way to tell each one what it needs to do, and there are many ways to do that.

    you could give them Bullet behavior and give each one a random angle and bullet speed when they are created. Or you could give them each an instance variable that tells them what type of object they are, and make rules for each type. you could loop through them using a For Each loop and always have the first instance do one thing, the second something else, etc...

    I adjusted your sample slightly to give them each a random X and Y speed.

    there are lots of other ways - you just have to get your head around all the various ways to "Pick" the instances so you can tell each one what to do...

    https://www.rieperts.com/games/forum/movesprites.capx

  • Alon

    I would definitely put them in a family.

    A global variable is fine, but you can also check EnemyFamily.Count any time you need to know how many there are as well.

    I usually try to keep the number of global variable down to as few as possible. I use instance variables and built in features like .Count, and .PickedCount, etc...

    it helps keep things organized.

  • I didn't see your sample file, so I am guessing, but when you use Create Object, the new instance does not get added to C2's internal list of objects until the next top level event after the event that created it. That means that it can not be picked or referenced in other functions until then.

    (Calling a function looks like it is on a different top level event, but the function is really just extending the event that calls it, and functions don't remember any picked objects).

    you can pick a new object by its UID, so if you have to call another function to do something to the object, you have to pass the UID as a parameter, and use that to pick it. Using instance variables, or anything else wont work immediately after the object was created.

    adding a "Wait 0 seconds" tells C2 to not execute actions after the wait until the end of the current tick - and by then new instances are available to be pick using all the other normal methods.

  • nettemple

    unless you can click faster than 60 times a second, the counter should have no problem keeping up. Usually the computer spends most of its time waiting for the user...

    I would have to see your code, but maybe it is not counting some - because it thinks they are double clicks, or some other event is blocking the count.

  • Societyisbabylon

    I have seen forum posts about this before and I know people have used various methods.

    The two easiest as far as I know are to use the ShadowLight object and give your walls the shadowCaster behavior. A more manual way is to have black sprites cover rooms until you enter the room.

    I a made a quick sample showing both methods. The area on the left uses ShadowLight, and the area on the right uses black sprites to block your view.

    https://www.rieperts.com/games/forum/LightMaskWalls.capx

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • jogibaer5000

    the name doesn't change. if you used Create Object to make an instance of Enemy, then its name is still Enemy.

    if there are other instances of Enemy, then you have to be careful how you "pick" them, otherwise any actions you do may apply to all instances - not just the one you expected.

    you can use instance variables to distinguish between them, or their UID, or Enemy(0).x or events such as Is Overlapping...

    in your example, you could use the "Self" reference, so it would be:

    Object(0) Set X to self.x + 5

    Object(1) Set X to self.x + 2

    etc...

    without the self reference you could also say:

    Object(4) Set Y to Object(4).Y + 1

  • Hex777

    sure, if you want to lerp to imagepoint 1, just set the position of the follower to:

    	follower set position to (lerp(Self.X,Sprite.ImagePointX(1),dt), lerp(Self.Y,Sprite.ImagePointY(1),dt))
    
  • Userame

    the easiest way to is pass the number into a function, then you can round it as you want, decide how many decimal places (if any) and then return the result...

    https://www.rieperts.com/games/forum/roundnumber.capx

  • Starconstructor

    in the properties for 8Direction, "Set Angle" to No

AllanR's avatar

AllanR

Member since 21 Nov, 2013

Twitter
AllanR has 23 followers

Trophy Case

  • 11-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Popular Game One of your games has over 1,000 players
  • x2
    Coach One of your tutorials has over 1,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

20/44
How to earn trophies