mindfaQ's Recent Forum Activity

  • How do I prevent blur observed when loading images from URLs into sprites that have a different image size than the image that got loaded from URL?

  • I haven't loaded your example but if blackhornet copied from your event:??Doesn't Construct 2 use degree instead of radian in sin()???Also better use pi instead of 3.141516

  • If you have your tiles saved in an array, you could work with that, identify adjacent tiles, add them to another array and check those adjacent tiles for objects.

    the other array could look like this:

    each x -> one tile

    y=0: x coordinate in tile-array

    y=1: y coordinate in tile-array

    y=2: status (0 = searched for object, 1 = searched for adjacent tiles)

    okay let's say you are at a junction at 5,5. You run your function.

    The function will return

    (4,5), (6,5), (5,4), (5,6). It didn't find an object, so it will look further. For each x in the array where at(curx,2) = 0 -> run the function again.

    The function should only add coordinates if they are not already in your array (to prevent from going back, searching fields twice). After every adjacent tile was checked for (4,5), its y2 is set to 1.

    The search/loops are stopped once an object was found or no new adjacent tile was added to the array. After that the array is cleaned up (set size to 1,1,1 I guess).

  • You can select your first line in the same fashion as you already know ("TileArray.CurY > 5") just use = 0 and curx

  • I gave you the answer in my first post.

    s000.tinyupload.com/index.php

  • And changing the image point back solves the problem?

    If it does, maybe just substitute player.x/y with (player.x/y+16) in every function, same for your enemies. This way the values should be the same if the new image point is in the upper left and was in the mid before.

  • Yeah, if you have a 2D-array the tile above would be array.at(array.curx,array.cury-1), left would be array.at(array.curx-1,array.cury) and so on. Be careful on the edges though, as array.at(-1,0) doesn't exist.

  • If I am not mistaken, Node webkit export doesn't utilize your browser, so erasing your browser cache won't change anything.

    There is also the no save behaviour, but that probably doesn't help in your case. Just wanted to mention that there is another mechanism to prevent saving of specific elements.

  • system compare: array.at(yourx,youry) = 0 (or "" if you mean an empty string)

    if you need to go through the whole array and do something with all elements that have a specific value, you can use this:

    array for each element XYZ

    system compare array.at(array.curx,array.cury,array.curz) = yourvalue : your actions

  • mindFAQ you're the best. i have no idea what the math does; but it works and exactly as i wanted it. i have one last question: if i add the code to a sprite and give the sprite the bullet-behavior then the sprite moves left to right. i want to have it move vertically. how can i do that? that's the last part of the puzzle. can you please help? thanks again for all your help.

    I didn't see this. If you want it to fly into another direction with the bullet behaviour, just modify the angle or the angle of motion of your sprite. An angle of 90 will make it move downwards, 270 upwards. If you change the angle, your picture will be rotated, if you only change the angle of motion, the picture will not rotate.

    DRTIAN: the on created event only triggers once when the object is created. We need to modify lastx and lasty each tick after the set position ran (just place them after it). Also I had a typo in my formula, instead of the 50 at set y (not sure where the 50 came from), it needs to be B if I overview this correctly. Hope it works now.

  • green.x

    green.y

    if you have more than one green, select by uid, comparison or instance variables beforehand

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • let's say your mid is 250, 250, then rotating your objects around it would look like this:

    2 instance variables for your sprites: ccc and speed. Speed = the angle difference each step. ccc decides the direction.

    code:

    system every 0.2 seconds: sprite set ccc to choose(-1,1)

    sprite set angle to sprite.angle+sprite.ccc*sprite.speed

    sprite set position to x = 250+cos(sprite.angle)*distance(sprite.x,sprite.y,250,250) and y = 250+sin(sprite.angle)*distance(sprite.x,sprite.y,250,250)

mindfaQ's avatar

mindfaQ

Member since 12 Oct, 2013

None one is following mindfaQ yet!

Trophy Case

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

Progress

13/44
How to earn trophies