mindfaQ's Forum Posts

  • You don't really need the CSV plugin to use the CSV2Array plugin, BUT the mentioned examples use the CSV plugin, so that's why they would not load.

  • If you are storing your texts in an array, it could look like this:

    dialogmode = 0

    function "displaydialog": set dialogmode = 1, system set timescale = 0

    • system create object dialog box
    • system create object text
    • text set text to array.at(x,0)
    • set (instance variable) text.nexttext to array.at(x,1)

    mouse clicked AND dialogmode = 1

    IF text.nexttext not equal to -1:

    • set text to array.at(text.nexttext,0)
    • set text.nexttext to array.at(text.nexttext,1)

    IF text.nexttext = -1:

    • destroy dialog box
    • destroy text
    • set dialogmode = 0
    • system set timescale = 1

    When you call the function you pause the game (timescale), we set a variable to identify in which state the game is in (dialogmode = 1), which you could add as condition to other events that might interfere with the dialog.

    then the dialog box and text are created. I assume we only have 1 instance of those in the layout - if not, you'd need to pick the correct instance each time you wanna work with it.

    It sets the text to the proper tex to display and in the array we also have stored which text to display next. The next text to display is stored in the text's instance variable nexttext and when we press on it the text gets changed accordingly. If nexttext is -1, it means the dialog is over and the game continues, so the dialog box and text are destroyed and game's state is set to the way it was before.

  • 1D array

    recording = 0

    event that starts recording: set size array to 0,1,1

    set recording = 1

    every tick AND recording = 1: push array at back x-axis, value = touch.AccelerationX (or whichever value you are interested in)

    to stop recording set recording to 0 again.

    to plot it, by using the canvas plugin:

    ~event that starts the plotting~: canvas begin path

    canvas path move to start point

    • for 0 to array.width-1: canvas line to x=loopindex y=300-array.at(loopindex)
    • canvas draw line

    If you want a continuos plot, you probably need to draw the (complete) line each tick instead and if there are more than maybe 200 elements in the array, you delete the first array OR for a more simple approach spawn a small pixel every tick with the bullet behaviour at the right and let it move to the right and destroy when it is off the graph.

  • same problem as mostaafa here (also tried setting the animation to "Idle" or "Posture"). Tried to save it again in spriter with the new file options, but no success.

    edit: okay, saving as scon and scml with the same name made it play the idle animation once, after that it stops. Using the stable release of Construct 2.

  • "PS: To get the second layout and event sheet I pressed new project. Does this have anything to do with it. Also its for HTML."

    This is where you went wrong. New project creates something separate from the current project, so you end up with Game A and Game B.

    Create the new layout inside of the project and you'll be fine.

  • The features implemented/working are:

    ? a fully functional menu (mouse controls)

    ? adjustable A.I. difficulty

    ? adjustable game duration

    ? adjustable detail level for graphical effects

    ? toggleable sound effects and music

    ? a simplistic menu background music

    ? your typical pong gameplay based on the physics behaviour

    ? keyboard controls (arrow keys)

    ? gameplay speeds up the longer you play

    ? if the ball is moving too slow horizontally, it gets a boost

    ? a short delay after the ball resets, before it starts moving

    ? messages for both win and lose states, a shortcut back to menu

    ? a nice 8-bit soundtrack and fitting sound effects

    Pong's typical gameplay is not based on physics, but simple rules. Reflection at the outer walls: angle of incidence = angle of reflectance (that works with the physics as long as we ignore friction, yes). But the most important thing that spices up Pong's gameplay: if the ball hits the upper half of the paddle it will go upwards, if it hits the lower half, it will go downwards; further on edge means it "higher" angle (EncryptedCow tried to emulate it with sculpting the paddles accordingly, although the result is still different).

    At game start, near 90?angle is not used, but probably only like up to 60?. Together with the paddle reflection stuff this will prevent the ball from ever going very slowly horizontally.

    Also another AI variant would be moving the paddle into the middle if the ball is moving away from it. This way it covers the biggest range when the ball comes back (especially relevant if the ball moves fast in relation to the paddle AI speed).

  • float()

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • if drawnline.count = nodes.count-1:

    pick nodes, nodes.number = 0 (or whatever you first one is): set next node x to nodes.x etc

    as subevent of the event where you set nextnode (which you should set to on touch start instead of is touching to save performance (even if it is very minor))

    all nodes connected:

    if drawnline.count = nodes.count-1: do stuff to show that game is completed

    (note: won't work if the line is supposed to skip inbetween)

  • xor is this one, no?:

    A true AND B true: do nothing

    Else A true: do something

    Else B true: do the same something

  • rexrainbow : would it possible to detect the the data type of each string automatically (with a tick box or something like that)? I need to convert the strings that are numbers to integers or floats manually inside of Construct 2 to make comparisons with other numbers (via system compare) work.

  • OlivierC: that's what I was suggesting, just using .csv instead of .xml because they are easier to export from spreadsheets if I am not mistaken

    ragnarok: example: s000.tinyupload.com/index.php

    image:

    <img src="http://i.imgur.com/JjgTSRg.png" border="0" />

  • Simple maze game: maze game

  • Took my shot at the randomized Prim's algorithm when the site was down: maze game

    Now I saw Yann's solution, so there is no need to show my approach (which is pretty much the same expect it uses 1d arrays instead of the data structure + I loop until generation is complete).

  • I don't know. Do you wait for the Ajax request to be completed before you enter the data into the CSV-plugin?

  • You need this: scirra.com/forum/plugin-csv-csv2array_topic46096.html

    there are example files as well. Use Ajax.lastdata in the field where you put the string.