Zebbi's Recent Forum Activity

  • What do you think, newt ?

  • EDIT: Fixed links!

    Okay, here's what I have so far, and it's terrible: https://www.dropbox.com/s/g61zuyo6gggk3 ... .capx?dl=0

    Here's the raycaster plugin: https://dl.dropboxusercontent.com/u/207 ... ce.c2addon

    This is the original game and it runs in the browser, so if you'd like to compare where his fires, here it is: https://archive.org/details/msdos_Dange ... nsion_1991

    I just can't quite work out how far to send the beam, since it shouldn't really go any further than the viewport, and the angle height is difficult to get right depending on how close to the edges you are, in my example, it doesn't work for the top of the level, the angle turns into a hard horizontal line.

  • Actually, if have a different code set if the player is mirrored, so it would switch to being half again outside the left side of the screen. But thinking about what you're saying, I can't think of a reason that wouldn't work! I just had this idea it would require something more technical, but I think if this works I'll be more embarrassed than I've ever been embarrassed before! Let me see...

  • really? you can null the y parts with a 0 just to retreive the x distance? I didn't know that!

    Yeah, I'm trying to get when the player is central to the screen exactly, so in the middle of a level, far from the sides, with scroll attached, let's say thats 0. If the player gets near to the left and the screen stops scrolling to the left, I want the figure to become a negative until the player touches the edge, in which case it should theoretically be minus half the screen width. For the right, if the layout gets to the edge, every point closer the player walks would add positive until the player hits the side and it should be positive half the screen width.

    Can I establish this distance as a range in this way?

  • yes, but is that a problem?

    I feel like I am missing something.. heh. Is the object's position relative to the player or the screen edge?

    It sounds like you're saying it's relative to the player, and when the player is in their typical position (the center) that falls just to the right of the view? When the player goes left of center, does the object go left of the edge?

    The player is central to the screen when it's scrolls with the player, except for the edges of the layout, where the scroll stops and the player gets closer to the viewport sides (and top and bottom for that matter) so i need to offset the change with a value, where the centre of the screen is 0 and if the player is closer to the left it's a minus figure and to the right a +, same goes for top and bottom. But I don't know to measure the distance of an object from the viewport sides

  • couldn't you just set it to be half the view width + player.x at all times? or did I misunderstand something?

    Yeah, but wouldn't the player.x be relative to the entire layout, rather than the position nearest the scrolling edge?

  • I'm trying to keep something to the right of the viewport, but I also want it so that depending on how close the player (who is being scrolled with) is to the viewport, the extra distance is added or subtracted, say, from the centre of the viewport (the centre being where the player will usually be because of scrolling, except for level edges). Any idea how to calculate just the X distance between and add the difference if the player is to the right-of-centre of the viewport or subtract if to the left-of-centre?

  • With a tilemap based pathfinder ? I dont see it.

    But is there a way of being able to test if the player is already on the tile you've clicked, and if so, just do a straight moveto?

  • Basically, I need to be able to know what maths to use:

    • to adjust the Y of the end point
    • when the X is positioned on the viewportright/left
    • and the start point is the player
    • to keep the ray at a 45 degree angle regardless of the players distance from the viewportright/left
  • Also, I found the cocoon.io performance (for my very pre pre alpha game) (using the accelerated Canvas+ option) to be maybe 20-30% better than native browser and other wrappers.

    Was that better than the latest XDK?

  • Using viewport right and left works for the normal aiming, but it fails miserably when I add some altitude to the Y for aiming up cos when you get close to the layout edge, your aim goes sharper inclined. So what I really need to do is set the second trace end relative to an angle and have the end point stop at the edge of the viewport, that way the angle would be consistent depending on how close or far from the level edge you are, but you never end up aiming outside of the vid able region. So what maths would I need for this?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Maybe i was overthinking it: https://www.dropbox.com/s/2slsyuyacgr1a ... .capx?dl=0

Zebbi's avatar

Zebbi

Member since 20 Jan, 2014

None one is following Zebbi yet!

Connect with Zebbi

Trophy Case

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

Progress

12/44
How to earn trophies