GingerBatMan's Forum Posts

  • Maybe Yann, or R0J0hound knows how to do this?

  • Hi guys,

    I'm trying to replicate a 2D water effect. Here's what I have so far: http://db.tt/6fsv1vTK

    As you can see I have made a chain, then when the block hits it; it makes a wave due to physics, then the canvas draws it.

    this looks pretty cool, allthough I need the canvas to map the water to everything below aswell as the links. so it actually looks like water.

    I was also wondering how to make the links move upwards, buoyancy I think its called. So when the block goes in the water, the water rises and so on.

    I was actually wondering if a genius could figure out how to do this without the canvas plugin as performance is pretty bad with it on.

    for example using sprite effects.

    I hope someone can help me!

    Thanks.

  • Looks amazing!

  • R0J0hound Thanks! I was wondering if you would know how to mask this line so everything below it is blue like water? <img src="smileys/smiley1.gif" border="0" align="middle" />. I saw you do something like this on your jelly physics demo, you created lines from each point or then filled it, but I do not see how this would apply to this. . any ideas?

    Thanks for helping me man!

  • R0J0hound, WOW! Thanks, Exactly what I wanted, I'm trying to replicate a water effect. so this would be the wave, when something hits it. Ignoring collision by applying a force of 1 :)

    I encountered a problem that maybe you can help me fix. If I set the window and layouts width to 960, the code works well making the line, but the line is too heavy so it makes a large dip which won't replicate my water effect. Do you know how I can fix this?

    Thanks.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • sqiddster, Thanks for the help.

    I'm sure Yann is genius enough to figure this out for me <img src="smileys/smiley1.gif" border="0" align="middle" />.

    I updated the capx if you want more of a understanding.

    Thanks.

  • sqiddster, Thanks for the reply. my bad, I though I attached my capx.

    Here is my attempt: http://db.tt/vgNMVoeq

    I am really struggling with this, any help would be appreciated.

    Thanks,

  • Using Yanns rope example I tried to modify it so I can replicate a effect I want.

    I want to attach the last instance of the rope to be attached to the sprite on the opposite side of the layout, and fill the distance with the rope, Is this doable? Can anyone help me out?

    Thanks.

  • Hi guys, I was wondering if something like this is possible with C2: http://www.scirra.com/forum/my-water_topic46267.html

    Maybe using the canvas plugin?

    It's quite essential for my game, I want to make realistic water and when something collides with it it reacts realisticallty, Is this possible with C2? Thanks.

  • Kyatric ,

    Yeah I know im sending the [name] and log. The problem is finding that name, Im probably really confusing people now.

    Essentially I want to be able to show the top 100 people's replays on the scoreboard, And the players own replays.

    But thats not important right now.

    I need to be able to search through the CSV for a [name] then display the specific data from that [name]

  • Kyatric, I looked into mySql earlier today.

    My server was taking too long to download the package so i will try again later. I understand the mysql part quite well. There are lots of example's out there for setting it up.

    The table would look like this:

    CREATE TABLE `myDB`.`usersystem` (

    `userid` INT NOT NULL AUTO_INCREMENT ,

    `username` VARCHAR( 50 ) NOT NULL ,

    `password` VARCHAR( 32 ) NOT NULL ,

    `email` VARCHAR( 50 ) NOT NULL ,

    PRIMARY KEY ( `userid` )

    )

    then the php like this: <?php

    session_start();

    mysql_connect("localhost", "username of your database", "password of database");

    mysql_select_db("myDB");

    function user_login ($username, $password)

    {

    //take the username and prevent SQL injections

    $username = mysql_real_escape_string($username);

    //begin the query

    $sql = mysql_query("SELECT * FROM usersystem WHERE username = '".$username."' AND password = '".$password."' LIMIT 1");

    //check to see how many rows were returned

    $rows = mysql_num_rows($sql);

    if ($rows<=0 )

    {

    echo "Incorrect username/password";

    }

    else

    {

    //have them logged in

    $_SESSION['username'] = $username;

    }

    }

    ?>

    The thing i don't quite understand is then how do i find the users name from the php that saves the replay?

  • Weishaupt

    Because the log is not one object is it?

    int(tokenat(State,0,","))

    int(tokenat(State,1,","))

    int(tokenat(State,2,","))

    we have to log the data 3 times?

    or am i supposed to send something else?

  • Weishaupt

    Yeah im gonna start work on the rotary comp as soon as i finish this :)

    Few more questions if its not too much trouble

    Sending the data -

    Curretly im sending it like this : "http://blablabla.com/post.php?name=BlaBlaBla&log="&int(tokenat(state,0,","))"

    But " log="&int(tokenat(state,0,",")) is only the x.. so how do i send the rest?

    Playing it back -

    How am i supposed to do this?

    sprite.SetX(Ajax.LastData)

    sprite.SetY(Ajax.LastData)

    sprite.SetAngle(Ajax.LastData)

    About the naming thing im obsessed with how do i do this -

    were sending a username: [name] in the PHP script, But say I have a scoreboard, how do i then search for the same name?

    Would something like this work?

    <?php

    $username = $HTTP_GET_VARS[name];

    $log = $HTTP_GET_VARS[log];

    $mystring = $HTTP_GET_VARS[CurrentUser];

    $findme   = $mystring;

    $pos = strpos($mystring, $findme);

    // Note our use of ===. Simply == would not work as expected

    // because the position of 'a' was the 0th (first) character.

    if ($pos === false) {

        echo "The string '$findme' was not found in the string '$mystring'";

    } else {

        echo "The string '$findme' was found in the string '$mystring'";

        echo " and exists at position $pos";

    }

    ?>

    But then how would i use this string to display the data of the current user?

  • Weishaupt, Did you see the capx.

    When I said "Don't Worry I figured it out." I meant the mysql part <img src="smileys/smiley1.gif" border="0" align="middle" />

    I also managed to do the login system, Without mySql, if you wish to see that i'll upload it soon :)

  • chrisbrobs,

    How did you make the player stay on the bike?

    pin?