Spider_hip's Forum Posts

  • Omg. I should start to math all over again.

    "RGB(clamp(lerp(GetRed(particle('fadetoColor')), GetRed(particle('fadefromColor')), particle('currentcolortime') / particle('colorfadetime')), 0, 255), clamp(lerp(GetGreen(particle('fadetoColor')), GetGreen(particle('fadefromColor')), particle('currentcolortime') / particle('colorfadetime')), 0, 255), clamp(lerp(GetBlue(particle('fadetoColor')), GetBlue(particle('fadefromColor')), particle('currentcolortime') / particle('colorfadetime')), 0, 255))"

    What are you talking about. How did you calculate it :). lerp inside of clamp. Sin, cos, tan. I wish I had listened my math teacher on my collage years.

    Thank you for sharing.

  • Wow , very nice game. There was a "Death Rally" game from apooge when I was a kid. I remembered that game. I loved "death rally". You can improve and make smth like that.

  • Oh actually If there was an easy way to do it It would have helped me a lot on my project too. Beceause on my project I give player a text. Than I want player to write it fast. If he writes a letter wrong than change that letter's color to red if its true change color to green. It would be perfect.

  • Now I thought about how can I handle if player deletes. And I guess I can use "on text changed" len(text3.text). If I use a variable to count the lenght of text. Than on text changed if lenght increased do regular codes. But if lenght decreased so user deleted something. Now do something about arrays and scores. <img src="smileys/smiley24.gif" border="0" align="middle" /> omg I should fix many things on deleting.

  • Thank you very much for your quick help jangsy5

    Well actually I prepared something with arrays. I don't know if it's stable or right way to do it but results are seem ok.

    Thank you for letting me know about left() and right() expressions. They helped me a lot.

    I used this;

    on start of layout -> Array: Set size to Numtokens(Source.text)*1*1

       For each element -> Array: Set index(Array.CurretX,Array.CurrentY) to Gettoken(Source.text,Array.CurrentX)

       For "count" from 1 to Array.sizeX -> Text2:Set text to Text2.text+Array((Loopindex),1)

    On text changed -> Text3:Set text to Text3.text+Right(EditBox.Text,1)

    Array2:Set index global("increase") to Right(Text3.Text,1)

    System: Add 1 to global variable"increase"

    Always Text4: Set text to Array(global("increase")-1)

    Text5: Set text to Array2global("increase")-1)

    Text4 compare Text 5 if true Text6: Set text("great")

    else Text6: Set text ("be careful")

    -------------------------------------------------------

    Yep I did something like that. First I added a text element which named source. And I wroted a text like this: "I,t, ,w,a,s, a, ,b,e,a,t,i,f,u,l, ,d,a,y"

    I used numtoken to count every character which seperated with comma. And set size with it.

    After that I used for each element loop to put those every character to x array line like x1=I x2=t x3="" x4=w etc.

    Than I used for "count" from 1 to array.sizeX write every character to text object. So people can see that paragraph without any commas.

    Than I added an edit box for player to write on.

    I used "on text changed" and used another text object to write to. So If player writes something(edit box text changed) than it also writes on text3 object. Than Array2 takes from that text 3 object's right() character to Array2's x line. I used a global variable "increase" for increase on every character input it takes that character to Array2 x1 than x2 than x3 etc.

    I used "always" write latest arrayX and array2X character. ArrayX character for (which character had to be written) Array2X character for (which character written)

    Than I compare those charactes with each other. If they are equal text 6 object returns "great" else "be careful".

    It seems eveything works as I want for now. Now I'll prepare some graphical animations for nice looking. I'll try to add score system(if they are equal add 1 to score) something like that.

    Still I don't know if I did it true way. Maybe your way was way better and easier for after edit or update. Probably there are better solutions to get same result. For example it's irritating to prepare your paragraph letter to letter with commas. Maybe there may be a loop which automatically puts commas between each letters. I don't know.

    Oh and I guess I should inhibit user to backspace(delete what he/she wrotes) to prevent arrays mixing. But I guess on edit box object I can't inhibit it. Or I should way to find if user deletes what it wrotes than I should delete latest arrays and decrease array x.

    Whatever thank you very much. Sorry I wrote too long :)

  • Hi all

    I would like to convert a paragraph with letter to array. Like this;

    "It was a beatiful saturday morning, birds were singing, sun was shining"

    Array x1=I x2=t x3=space x4=w x5=a and goes on like that.

    I guess I can do this with simple loop maybe from a text file to array, but I can't produce any idea now. I don't want to spend time with writing it letter to letter by myself, beceause I may change my paragraph later.

    Reason of my wish is;

    After I filled an array with that paragraph, I will want user to write that paragraph as fast as they can without any mistakes or with some mistakes. I think I will use an second array line for user's inputs. And than I will compare user's array and paragraph's array. Than handle score system with mistakes and time.

    I feel sorry beceause of asking probably very simple thing on here. Still I try to solve this by myself until someone helps :) thank you vey much.

  • Many professional pc user already use chrome or firefox. ie looses its market share day to day. And I guess half of ie's market share comes from ie6 beceause of unconscious xp users. Don't get me wrong but statistics says so. And this is(ogg support) also a good point for 2 age chrome and firefox power.

    Still of course I support your site.

  • I used with hamachi. It works great. Thank you. Superb plugin.

  • Hi lucid, I downloaded your cap. I have s plugin and perlin noise plugin. When I click to Run All, I have a white blank screen. I have Construct Classic r1.2 Why it might be like that ?

  • Wow thank you very much for spending your time to explain all these stuff to me. You have explained all of them perfect. I will read twice, three times, until It sticks in my mind :) Really amazing to know these expressions, functions and especially to use them in neccessary areas. If I had knew these lerp and clamp before, I'm prety sure that I couldn't think of using them for this gravity effect :)

    See you soon :) I'll try and play with these. Thank you for teaching me :)

  • I couldn't get distance function. How can you divide a value which includes 4 values to a value ?

    distance(Sprite2.x,Sprite2.y,Sprite.x,Sprite.y)/global('maxdistance')

    Is there any document that I can find all usable functions on construct with their meanings ?

    Thank you very much.

  • Omg, youre amazing. And you call mine complex :) Omg Yeah it maybe easy for you but I had never heard about clamp and lerp. I envy you. I wish I had learnt them when I was at school.

    Our teachers taught us sin,cos,tan as reading book. I always asked them, how can I use them in reality, how can I see results if I use them. They never told me that I can use in game/animation programming. Now even jumping with sin , or making a round object with, sin sounds too weird for me.

    Whatever :) It works perfect. Thank you very much.

    I searched a bit about "clamp" and "lerp".

    Lerp only interpolates between 0.0 and 1.0

    Clamp a value between a minimum float and maximum float value. If value is higher than max value, than result equals to max value, same for min value.

    I quite understand them in theory but It's still difficult for me to understand it on runtime.

    Thank you, thank you, thank you. I hope you can share more examples like this if you have spare time.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Why not ? You don't have to use specific values for gravity. You can easily use your blackhole's x and y positions. So when you spawn or create them on random positions gravity position changes with them.

    I prepared a second example for this;

    spacedemo-0.01.cap

    http://hotfile.com/dl/124424992/379f635/spacedemo-0.01.cap.html

    I know it's not realistic as I mentioned on my previous post but you can make it more realistic with being a bit more specific with codes. I mean you can expand it. For example you can create a wide round object around your blackhole. And you can write like, if object collides with round object than start gravity. So if your map will be big, you can handle gravity areas for your blackholes. Than you can expand x+1 and y+1 codes. Like if y distance greater than x distance than y+2 x+1. So maybe you can prevent that issue. Or you can think about something else.

  • I meant this; I prepared a demo for you.

    spacedemo.cap

    http://hotfile.com/dl/124408509/d8c1d52/spacedemo.cap.html

    You can control spaceship with arrows.

  • Well I had done something like that with same logic. But for different reason. I had an arena which I wanted to give it depth. So if player go far from the center and don't move, it slowly goes to the center.

    I did it like this way;

    If object.x > center.x than

    move 1pixels at 180 degrees

    If object.x < center.x than

    move 1pixels at 0 degrees

    If object.y > center.y than

    move 1pixels at 270 degrees

    If object.y < center.y than

    move 1pixels at 90 degrees

    -------------------------------

    It handles what you want a bit. But it's not perfect. Needs smth else. Beceause for example:

    if object x is 40pixels far from center x and object y is 100pixels far from center y than. it adds 1 to x and y at the same time. So first it reaches to true x point than it contunious to y increasement. So it doesn't look good. Beceause first it goes up-right than it goes only right.

    --------------------------------

    There maybe nice solution for your need. I'm looking foward to learn it too. I can use it on my game to fix my problem :)