R0J0hound's Recent Forum Activity

  • Fun problem!

    I had to have a go at it, but it's not the simplest.

    https://dl.dropboxusercontent.com/u/542 ... s_sim.capx

    Dropping leaves has never been so much fun.

  • You could use the clamp() expression.

    every tick

    set variable to clamp(variable, 0, 10)

  • If that gets the first word this will get a random one:

    tokenat(AJAX.LastData,int(random(tokencount(AJAX.LastData,","))), ",")

  • The visual event sheets of C2 are the principle way to code logic. You could use the plugin sdk and use JavaScript but it's not really a replacement for events.

    You also can run snippets of js with the browser plugin but it has no access to the rest of c2.

    The request to use scripting instead of events has been made before, and it won't be added.

  • This should do it I think. The "---" means subevent.

    Start of layout

    gamearray: set size to (array1.width+array2.width, 7,1)

    --- array1: for each xy element

    ---> gamearray: set at (array1.curX, array1.curY, 1) to array1.curValue

    --- array2: for each xy element

    ---> gamearray: set at (array2.curX+array1.width, array2.curY, 1) to array2.curValue

  • It's just an image so the rough process is to:

    1. load it into a sprite

    2. paste it into the third party canvas object

    3. loop over the pixel with two for loops

    4. look at the color and do something with it.

  • If the arrays are one dimensional (ex: with size (n, 1,1)) then you could do this:

    start of layout

    gamearray: load from json string Array1.AsJSON

    ---- array2: for each x element

    ----> gamearray: push back array2.curvalue on x axis

  • Phealin

    It's very doable, and a sort isn't needed.

    You can use "repeat" or "for" to loop over the letters.

    Use the len() expression to set the length of the loop, then the mid() expression to get the individual letters.

    Next you need to convert the letters to a number. You could do it the long way by making an event for each, or you could use the find() expression [expained below].

    Wrapping the value around when adding a number can be do by using the % operator.

    Finally converting the number back to a letter can be done with mid() in a similar way to using find().

    As an example the following should encode your text.

    Global text input="hello"

    Global text output=""

    Start of layout

    set array size to (7,1,1)

    set array at 0 to 6

    ...

    set array at 6 to 2

    Global text letter=""

    Global number value=0

    Start of layout

    Repeat len(input) times

    set letter to mid(input, loopindex, 1)

    set value to find("abcdefghijklmnopqrstuvwxyz", letter)

    set value to (value+array.at(loopindex%array.width))%26

    add mid("abcdefghijklmnopqrstuvwxyz", value, 1) to output

    That works any input that consists of only lowercase letters.

  • zenox98

    That's the one. That's no good if it's not connected to the reporting system.

  • It's just an annoyance really. In order to report a game you have to open it, and as a result you get logged as a recent player.

    Anyways the arcade looks to be in need of more moderation, merely by seeing the new game's thumbnails/title.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I still don't see why a layer couldn't be used instead of the imagepoints. Creating/destroying the objects as you switch tabs won't really save you any memory, although I do see the value of destroying it instead of hiding it since you wouldn't have to check if the objects are on a visible layer before interacting with them.

    They way I see it imagepoints could be useful perhaps if those widows are moved around. Still I'd probably opt for using the pin behavior or storing the xy offsets in a variable. Also it's much quicker to just position stuff in the editor than to tweak imagepoints. If I wanted to create/destroy the windows i'd use a array to store the object types,sizes,frame,text,and position at the start of the layout, then just loop through that when I wanted to recreate it.

    For organizing object types I'd actually opt to use less object types and instead use variables and animation frames to distinguish them. Of course this largely depends on what I'm doing.

  • This should do it:

    Every tick:

    ---- set text to min(float(self.text)+100*dt, score)

    But personally I'd use a second global var that increases toward the score. Then I'd just show a rounded number.

    global number display=0

    Every tick:

    ---- set display to min(display+100*dt, score)

    ---- set text to int(display)