User Tag List

Page 6 of 6 FirstFirst ... 4 5 6
Results 51 to 60 of 60

Thread: My 1st Game - Sokoban - Need Help

  1. #51
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export Module
    Sumo's Avatar
    Join Date
    Jul 2008
    Posts
    642
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    if you're just doing 1 undo, then you dont even need anything crazy like all that array stuff. just have a few alterable variables that save the x and y position and direction of the block before you move one step. then if you undo, read the variables and position the blocks back to their previous position.

    Edit: Here you go, I made a quick example.
    Attached files Attached files

  2. #52
    Clicker Fusion 2.5HTML5 Export Module

    Join Date
    May 2017
    Location
    Sabattus, ME
    Posts
    91
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Sumo View Post
    if you're just doing 1 undo, then you don't even need anything crazy like all that array stuff. just have a few alterable variables that save the x and y position and direction of the block before you move one step. then if you undo, read the variables and position the blocks back to their previous position.

    Edit: Here you go, I made a quick example.
    I thought of that, but couldn't quite figure it out yet.


    Thanks SUMO!!

  3. #53
    Clicker Fusion 2.5HTML5 Export Module

    Join Date
    May 2017
    Location
    Sabattus, ME
    Posts
    91
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I redesigned the way my player moves to accommodate just 1 undo (thanks Sumo)

    Everything is working fine, but what I want to do now is to be able to move slowly with single presses on the keyboard, but when the user presses down continually, the player (and blocks) will move faster.

    I have set the frame rate based on single key (10) or repeat press (30)
    I have this setup, but the single key and the repeating press of key clash and movement is always too fast.
    Its like the repeating takes over

    I tried the OR code, but I can't seem select the frame rate if I use OR in the same block

    So, what I want do is account for both key scenarios, but still only set one undo depending on press key it is.

  4. #54
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export Module
    Sumo's Avatar
    Join Date
    Jul 2008
    Posts
    642
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    You dont want to mess with your frame rate. Keep it locked and instead use timers to limit the speed at which the events trigger when you're always holding down a key. For example:

    +Repeat while "W" is pressed
    +Every 0.25 seconds
    -Set Y position to Current Y position-32

    You'll probably have to split up the movement lines into separate parts instead of using the OR filter. When you first press the key you could switch a flag on, then for your Repeat while key is pressed conditions you can also test to see if the flag is off. Therefore it wont trigger when you first press the key.

  5. #55
    Clicker Fusion 2.5HTML5 Export Module

    Join Date
    May 2017
    Location
    Sabattus, ME
    Posts
    91
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Sumo View Post
    You dont want to mess with your frame rate. Keep it locked and instead use timers to limit the speed at which the events trigger when you're always holding down a key. For example:

    +Repeat while "W" is pressed
    +Every 0.25 seconds
    -Set Y position to Current Y position-32

    You'll probably have to split up the movement lines into separate parts instead of using the OR filter. When you first press the key you could switch a flag on, then for your Repeat while key is pressed conditions you can also test to see if the flag is off. Therefore it wont trigger when you first press the key.
    Okay... I will give that a try.
    Yeah because the "repeat press key" overrides the regular key press

    In VB & C#, we woulds specify key-down & key-up

    So, even though I know where I want to be, it's just different using this visual events editor.

    Thanks sir

  6. #56
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export Module
    Sumo's Avatar
    Join Date
    Jul 2008
    Posts
    642
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    There is a "Key Object" and "Control X Object" that has those features you're talking about- testing when the user does key-down and key-up presses

  7. #57
    Clicker Fusion 2.5HTML5 Export Module

    Join Date
    May 2017
    Location
    Sabattus, ME
    Posts
    91
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Okay...
    I have finally worked out the bugs on my game engine as far as player movement and getting the undo to work.

    I have a sample Level Editor (Array Level Builder 2.5b) that I found. Seems to do what I am hoping to implement.

    However, as I think about how to load level.arr files....

    I am not sure how I can dynamically choose the right file (using only one button on main frame) without using a separate button to actually call the file "level1.arr, level2.arr etc etc"

    For example...
    After "finishing a level" the user clicks the "Next Level" button. This button is on the main game window and not on the level I create separately

    So, on my button click I want to go to the next "level?.arr" file. (? being the level number)

    So, at game startup it will load... "level1.arr" automatically
    But, when I click to go to next level, how can I choose "level2.arr" without opening a file selection window??

    Understand what I mean?

  8. #58
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export Module
    Sumo's Avatar
    Join Date
    Jul 2008
    Posts
    642
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    My 1st Game - Sokoban - Need Help

    Save a global value that records the current array number you're on. So on level 1, the global value starts at 1. When you start the next frame, add +1 to the global value. Then you can retrieve the array file using

    AppPath$+"ArrayName"+Level Number Global Value+".arr"

    If you want to organize it a bit using a folder in the same location of the game, you could do:

    AppPath$+\Game Levels\+"ArrayName"+Level Number Global Value+".arr"

    Backslashes tells Fusion to go deeper into the file system to look for a folder called "Game Levels".

    Sent from my iPhone using Tapatalk

  9. #59
    Clicker Fusion 2.5HTML5 Export Module

    Join Date
    May 2017
    Location
    Sabattus, ME
    Posts
    91
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Sumo View Post
    Save a global value that records the current array number you're on. So on level 1, the global value starts at 1. When you start the next frame, add +1 to the global value. Then you can retrieve the array file using

    AppPath$+"ArrayName"+Level Number Global Value+".arr"

    If you want to organize it a bit using a folder in the same location of the game, you could do:

    AppPath$+\Game Levels\+"ArrayName"+Level Number Global Value+".arr"

    Backslashes tells Fusion to go deeper into the file system to look for a folder called "Game Levels".

    Sent from my iPhone using Tapatalk
    I was just going to say.... that I figured it out with the same solutions.

    Thanks

  10. #60
    No Products Registered

    Join Date
    Aug 2016
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Now, I will try to get around that.

Page 6 of 6 FirstFirst ... 4 5 6

Similar Threads

  1. Creating an Undo Command for Sokoban
    By Simflare in forum Fusion 2.5
    Replies: 29
    Last Post: 1st June 2017, 01:50 AM
  2. Claustophobia (HTML5 free game made for internal game jam event)
    By SiXX in forum WIP & Released Games & Apps
    Replies: 5
    Last Post: 12th March 2016, 04:26 PM
  3. Sokoban (Flash Game)
    By warlords in forum Released Games & Apps in Flash
    Replies: 0
    Last Post: 14th January 2014, 10:32 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •