Aleq's Forum Posts

  • if you mean less actions and conditions for efficiency i have another idea.

    Forget about the instance variables. Just turn off red dots collision on default and turn their collision on after 4 seconds. U need to remove your "overlapping" conditions in this case. I still dont understand why do u need "overlapping" anyway. Collision also means objects has been overlapped already.

    I think it would be better couse less actions/conditions means more efficient game running.

    However im not an expert on C2 performance issues. So i dont know it very well if it is better to playing with collision instead of using instance variables. But less coding for sure.

    But in normal cases one of the most performance killer ting is checking collisions on each update tick on games. if there are alot of items to check collisions ur game has lesser performance. With this style ur sprites at lest will not have any collision checking for 4 seconds lol

  • give red dot an instance variable like vulnarable=false

    after you spawn that object put wait 4 seconds action and after that set that variable to true.

    only do actions if its variable is true

    use the one below if your game glitches, dont remember the object and make all of the red dots instance variable's true

    give red dot an instance variable like 4.

    every 1 second of game time pick all red dots and reduce their instance varibale by 1 if its not already 0

    do actions with red dots only if their instance variable is equal to 0

    however you will see from the attached file (just draw something and wait) it perfectly remembers the last created object

  • i may suggest

    increase the time object spawns dramatically. reduce jumps speed a bit but allow users cotinue jump from where it is like on flappy bird so we can do movement manuevers to achive a hit and avoid objects.

    changing background to underwater suits better with my idea

    oops isnt that flappy bird again? sorry

  • "Browser" object -> "On resized" event.

    change everything manually if you wanna make responsive design. There is not an "Auto" method as i know. But i might be wrong

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • sorry but its not harder than flappy bird. i made 17 first time i play it. On flappy bird you cannot even do 3 on first try.

    + on flappy bird everything is under "your" control. u die becouse of your own mistake. Thats why people obsessed that much to achieve something on this.

    on your game you just jump and hope you are lucky. So where theres only "luck" challenge is not there.

  • i cant find it on google play. may be my device is not suitable. can u posta direct link?

  • whenever an object collide that actually means its overlapping another object.

    General collision algorithms generates an area becouse of this, not a point. So you cannot get a point of collision happened.

    (i may be wrong on this issue not expert enough on construct 2)

    You may be find "overlapping at offset" useful on this issue. sou you can dedect from which side does it hits by using x,y coordinates in an object itself and manipulate the angle according to the side

    also this thread may help you too:

  • nimos100 is saying it right Zygorithm however, you "have to" reduce all possible calculations due the performance issues when you are making a html based game.

    using browser objects "onresized" event and assigning width and height on variables is better then forcing browser to re calculate the with and height each time you need them. specially on loops.

  • hadeelayadi Can you please explane your game mechanics a bit more?

    I may misunderstood what you mean.

    According to your reply i understood that you are not calculating score each time a fish has been chought.

    you wait for sometime and calculate at the end

    if im right theres no way to findout if something not touched in short way. Like a pre made construct 2 condition. You have to manipulate that.

    Like, make a global variable forexample "GoodFishChought" default value can be either "false" or "0" or even "no" something you can understand.

    Put a "sub event" on each sprite touch event to check if it is a good fish or not. you can do this adding an instance variable to all good fish sprites and using compare instance variabe.

    if its a good ship then make this variable "true", "1" or "yes".

    at the and of the level before calculating the score check this variable if its "true", "1", or "yes" you will know that player chought at least 1 good fish so score will not be minus.

  • How do I compare sprites value equal to OR sprites value is 0? I'm not sure how does the & and | works in the condition.

    as i remember

    when creating a condition select your sprite-> compare instance variable

    Also to understand how to do loops within same kind of sprites look at "pin chain style" example on construct 2

    its in the examples folder where construct 2 is located (propably at program files -> construct 2)

  • sorry construct 2 isn't with me right now so i cannot try to make exact conditions or actions but i may help with an algorthm

    set compareValue = -1

    set counter = 0

    *********loop for each row of sprites ************

    pick sprite

    **compare if sprites value equal to compare value OR spires value is "0"**

    counter = counter +1

    **else**

    set compare value = picked sprites value

    set counter= 1

    ** end if **

    ********* end loop ************

    if counter >=4 add xxx to players score

    set counter = 0

    compare value is set to -1 so we gaurantee that first pick will always false

    if you going to destroy the objects after achieving a score make their isntance variable like toBeDestroyed=true if conditions are met. if not, pick all reset the variables and continue like:

    *********loop for each row of sprites ************

    pick sprite

    set sprites toBeDestroyed = true

    **compare if sprites value equal to compare value OR spires value is "0"**

    counter = counter +1

    **else**

    set compare value = picked sprites value

    set counter= 0

    pick all sprites, and make toBeDestroyed= false

    ** end if **

    ********* end loop ************

    if counter >=4 add xxx to players score

    set counter = 0

    pick all sprites if toBeDestroyed =true then destroy.

    i hope u understood what i ment. sorry for such stupid coding

  • Whan you make something scaleable, you cannot use exact numbers anymore.

    You should always use relative positions. Best way to do is keeping numbers in variables. like gameWidth, gameHeight. You have to re assign this variables everytime screen changes.

    and ur conditions will be like this, "when TouchStartX < gameWidth/2"

  • Give every fish an instance variable about their scores. Forex you have 3 kind of fish

    Gold Fish => variable =5

    Ordinary Fish=> variable =1

    Bad Fish=> variable = -1

    when someone catches a fish add their instance variable to players score adding a negative value will substract that value

    with this style you dont need to use conditions, less calculations and ur game has more performance.

  • I haven't tried exporting to android yet. I assume that apk file generated is a browser, running html 5 page as a game.

    If your game is also works slow on any kind of browser in your mobile device, after you export it as a html 5 website and tested by link, i think you cannot do too much for this. Altering graphics, animations and calculations may only help.

    Also if you didint used "effects", try disableing and enabling "Web GL" on your project properties while exporting to test if there is a faster way with or withouth it.

    while i said effects, sometimes making a sprite for an effect instead of using calculations gives alot of performance.

  • you need to add browser object first

    after that you are avaible to use browsers "Go to URL" action