User Tag List

Page 2 of 2 FirstFirst 1 2
Results 11 to 20 of 20

Thread: How to get the movement of the Space Pilot spacecraft?

  1. #11
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Location
    UK
    Posts
    1,444
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by fredetmumu View Post
    i just try space pilot and it seems that when you release keys, rotation stop at the actual angle and not at the next diagonal
    That's true.

    Stopping at the diagonals is actually quite tricky. Technically, my version does it, but you need to release two arrow keys at *exactly* the same moment, which is very difficult.
    You could easily make it so that once the player stops pressing any arrow keys, the ship rotates towards the nearest of the 8 main directions, but with 360 degree sprite rotation it will look quite "jittery" (with 32 directions of animation, you could probably get away with it).

    eg. https://1drv.ms/u/s!Atq7cUIJ7uexsU0Q...Bpki-?e=YKMNlY

    The only alternative that springs to mind, would be to add some kind of delay, to check if the player releases the two arrow keys at *almost* exactly the same time - but that would make the controls less responsive, which is the last thing you want to do in a fast-paced shooter.

    Personally, I actually found that control scheme really awkward and unnatural. I grew up playing a lot of Sopwith II ( https://www.youtube.com/watch?v=B8SLHKPxw4Q ) and various Asteroids clones, so something more like a racecar movement feels a lot better to me (and more "realistic" - if you're flying a plane, you don't pull the joystick left to fly East; you pull it left to turn left).

  2. #12
    Clicker

    Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)Firefly 3D Module (Steam)

    Join Date
    Jun 2006
    Location
    Killeen, TEXAS
    Posts
    1,087
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    i wrote a bosconian and also time pilot clone.. i should really check out what i did on those, coz it seems like the same 8 dir movment you're after. - i will check later tonight at home if you're still struggling with this

  3. #13
    Clicker

    Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)Firefly 3D Module (Steam)

    Join Date
    Jun 2006
    Location
    Killeen, TEXAS
    Posts
    1,087
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Ok, upon checking, the bosconian used 8 dir, and was "so so" it still did angles, but the Time Pilot was all coded, and its really good... but not a simple do this and this... it has 40 lines (although it could be optimized), but it involved setting a direction target, and then rotating the ship depending on which way it was going to the new dir, So it flew in every direction properly without resetting back to other anges.

  4. #14
    Clicker

    Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)Firefly 3D Module (Steam)

    Join Date
    Jun 2006
    Location
    Killeen, TEXAS
    Posts
    1,087
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    My code for time pilot flying:
    Code:
    [ fly jet ]
    
    	* direction target of player jet >= 32
    		player jet : Set direction target to 0
    
    	* facing direction of player jet >= 32
    		player jet : Set facing direction to 0
    
    	// select a direction to face jet
    
    	* Always
    		player jet : Set direction to facing direction( "player jet" )
    
    	// determine which way to rotate depending on target direction
    
    	// facing 0
    
    	* facing direction of player jet = 0
    	+ direction target of player jet >= 4
    	+ direction target of player jet <= 16
    	+ player jet: do turn is on
    		player jet : Add 4 to facing direction
    		 player jet : Set do turn off
    
    	* facing direction of player jet = 0
    	+ direction target of player jet >= 20
    	+ player jet: do turn is on
    		player jet : Set facing direction to 28
    		 player jet : Set do turn off
    
    	// facing 4
    
    	* facing direction of player jet = 4
    	+ direction target of player jet >= 8
    	+ direction target of player jet <= 20
    	+ player jet: do turn is on
    		player jet : Add 4 to facing direction
    		 player jet : Set do turn off
    
    	* facing direction of player jet = 4
    	+ direction target of player jet >= 24
    	+ player jet: do turn is on
    		player jet : Set facing direction to 0
    		 player jet : Set do turn off
    
    	// facing 8
    
    	* facing direction of player jet = 8
    	+ direction target of player jet >= 12
    	+ direction target of player jet <= 24
    	+ player jet: do turn is on
    		player jet : Add 4 to facing direction
    		 player jet : Set do turn off
    
    	* facing direction of player jet = 8
    	+ direction target of player jet >= 28
    	+ player jet: do turn is on
    	  OR
    	* facing direction of player jet = 8
    	+ direction target of player jet < 8
    	+ player jet: do turn is on
    		player jet : Set facing direction to 4
    		 player jet : Set do turn off
    
    	// facing 12
    
    	* facing direction of player jet = 12
    	+ direction target of player jet >= 16
    	+ direction target of player jet <= 28
    	+ player jet: do turn is on
    		player jet : Add 4 to facing direction
    		 player jet : Set do turn off
    
    	* facing direction of player jet = 12
    	+ direction target of player jet < 12
    	+ player jet: do turn is on
    		player jet : Set facing direction to 8
    		 player jet : Set do turn off
    
    	// facing 16
    
    	* facing direction of player jet = 16
    	+ direction target of player jet >= 20
    	+ direction target of player jet <= 32
    	+ player jet: do turn is on
    		player jet : Add 4 to facing direction
    		 player jet : Set do turn off
    
    	* facing direction of player jet = 16
    	+ direction target of player jet < 16
    	+ player jet: do turn is on
    		player jet : Set facing direction to 12
    		 player jet : Set do turn off
    
    	// facing 20
    
    	* facing direction of player jet = 20
    	+ direction target of player jet >= 24
    	+ player jet: do turn is on
    	  OR
    	* facing direction of player jet = 20
    	+ direction target of player jet <= 4
    	+ player jet: do turn is on
    		player jet : Add 4 to facing direction
    		 player jet : Set do turn off
    
    	* facing direction of player jet = 20
    	+ direction target of player jet < 20
    	+ player jet: do turn is on
    		player jet : Set facing direction to 16
    		 player jet : Set do turn off
    
    	// facing 24
    
    	* facing direction of player jet = 24
    	+ direction target of player jet >= 28
    	+ player jet: do turn is on
    	  OR
    	* facing direction of player jet = 24
    	+ direction target of player jet <= 8
    	+ player jet: do turn is on
    		player jet : Add 4 to facing direction
    		 player jet : Set do turn off
    
    	* facing direction of player jet = 24
    	+ direction target of player jet < 24
    	+ player jet: do turn is on
    		player jet : Set facing direction to 20
    		 player jet : Set do turn off
    
    	// facing 28
    
    	* facing direction of player jet = 28
    	+ direction target of player jet <= 12
    	+ player jet: do turn is on
    		player jet : Add 4 to facing direction
    		 player jet : Set do turn off
    
    	* facing direction of player jet = 28
    	+ direction target of player jet >= 16
    	+ direction target of player jet < 28
    	+ player jet: do turn is on
    		player jet : Set facing direction to 24
    		 player jet : Set do turn off
    
    	// reset flag
    
    	* Always
    		 player jet : Set do turn off
    
    	// fly
    
    	* Repeat while Player 1 Moved top
    	+ NOT Repeat while Player 1 Moved left
    	+ NOT Repeat while Player 1 Moved right
    	+ NOT Repeat while Player 1 Moved down
    		player jet : Set direction target to 8
    
    	* Repeat while Player 1 Moved top
    	+ Repeat while "Left Arrow" is pressed
    	+ NOT Repeat while Player 1 Moved down
    	+ NOT Repeat while Player 1 Moved right
    		player jet : Set direction target to 12
    
    	* Repeat while Player 1 Moved top
    	+ Repeat while Player 1 Moved right
    	+ NOT Repeat while Player 1 Moved down
    	+ NOT Repeat while Player 1 Moved left
    		player jet : Set direction target to 4
    
    	* Repeat while Player 1 Moved right
    	+ NOT Repeat while Player 1 Moved down
    	+ NOT Repeat while Player 1 Moved left
    	+ NOT Repeat while Player 1 Moved top
    		player jet : Set direction target to 0
    
    	* Repeat while Player 1 Moved left
    	+ NOT Repeat while Player 1 Moved down
    	+ NOT Repeat while Player 1 Moved top
    	+ NOT Repeat while Player 1 Moved right
    		player jet : Set direction target to 16
    
    	* Repeat while Player 1 Moved left
    	+ Repeat while Player 1 Moved down
    	+ NOT Repeat while Player 1 Moved top
    	+ NOT Repeat while Player 1 Moved right
    		player jet : Set direction target to 20
    
    	* Repeat while Player 1 Moved right
    	+ Repeat while Player 1 Moved down
    	+ NOT Repeat while Player 1 Moved top
    	+ NOT Repeat while Player 1 Moved left
    		player jet : Set direction target to 28
    
    	* Repeat while Player 1 Moved down
    	+ NOT Repeat while Player 1 Moved top
    	+ NOT Repeat while Player 1 Moved left
    	+ NOT Repeat while Player 1 Moved right
    		player jet : Set direction target to 24
    
    	// SHOOT
    
    	* Player 1 Pressed fire 1
    	+ Number of player bullet < 3
    		New Objects : Create player bullet at (-5,-2) from player jet (action point)
    		player bullet : Set direction to Dir( "player jet" )
    		player bullet : Set speed to 40
    		 player bullet : Bring to back
    
    	* Always
    		player bullet : Add 1 to Alterable Value A
    
    	* Alterable Value A of player bullet >= 40
    		player bullet : Destroy
    
    	* player bullet leaves the play area
    		player bullet : Destroy
    
    	// hits
    
    	* Collision between player bullet and biplane
    		biplane : Destroy
    		player bullet : Destroy

  5. #15
    Clicker Fusion 2.5 DeveloperiOS Export ModuleUnicode Add-on
    daryuss's Avatar
    Join Date
    Apr 2012
    Location
    Italy
    Posts
    262
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    MuddyMole, danjo and the others who responded. Many thanks. Also you are right, leaving the keys the rotation of the spacecraft stops, the tutorial you have done is perfect (I did not have time to check it well). I'm not as good as you are, so the best I can do is reciprocate by sharing this little game that I planned a few years ago, and I hope you like it:
    https://community.clickteam.com/threads/103117-Clone-of-Bosconian-project

  6. #16
    Clicker Fusion 2.5 DeveloperiOS Export ModuleUnicode Add-on
    daryuss's Avatar
    Join Date
    Apr 2012
    Location
    Italy
    Posts
    262
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by danjo View Post
    My code for time pilot flying:
    Code:
    [ fly jet ]
    
    	* direction target of player jet >= 32
    		player jet : Set direction target to 0
    
    	* facing direction of player jet >= 32
    		player jet : Set facing direction to 0
    
    	// select a direction to face jet
    
    	* Always
    		player jet : Set direction to facing direction( "player jet" )
    
    	// determine which way to rotate depending on target direction
    
    	// facing 0
    
    	* facing direction of player jet = 0
    	+ direction target of player jet >= 4
    	+ direction target of player jet <= 16
    	+ player jet: do turn is on
    		player jet : Add 4 to facing direction
    		 player jet : Set do turn off
    
    	* facing direction of player jet = 0
    	+ direction target of player jet >= 20
    	+ player jet: do turn is on
    		player jet : Set facing direction to 28
    		 player jet : Set do turn off
    
    	// facing 4
    
    	* facing direction of player jet = 4
    	+ direction target of player jet >= 8
    	+ direction target of player jet <= 20
    	+ player jet: do turn is on
    		player jet : Add 4 to facing direction
    		 player jet : Set do turn off
    
    	* facing direction of player jet = 4
    	+ direction target of player jet >= 24
    	+ player jet: do turn is on
    		player jet : Set facing direction to 0
    		 player jet : Set do turn off
    
    	// facing 8
    
    	* facing direction of player jet = 8
    	+ direction target of player jet >= 12
    	+ direction target of player jet <= 24
    	+ player jet: do turn is on
    		player jet : Add 4 to facing direction
    		 player jet : Set do turn off
    
    	* facing direction of player jet = 8
    	+ direction target of player jet >= 28
    	+ player jet: do turn is on
    	  OR
    	* facing direction of player jet = 8
    	+ direction target of player jet < 8
    	+ player jet: do turn is on
    		player jet : Set facing direction to 4
    		 player jet : Set do turn off
    
    	// facing 12
    
    	* facing direction of player jet = 12
    	+ direction target of player jet >= 16
    	+ direction target of player jet <= 28
    	+ player jet: do turn is on
    		player jet : Add 4 to facing direction
    		 player jet : Set do turn off
    
    	* facing direction of player jet = 12
    	+ direction target of player jet < 12
    	+ player jet: do turn is on
    		player jet : Set facing direction to 8
    		 player jet : Set do turn off
    
    	// facing 16
    
    	* facing direction of player jet = 16
    	+ direction target of player jet >= 20
    	+ direction target of player jet <= 32
    	+ player jet: do turn is on
    		player jet : Add 4 to facing direction
    		 player jet : Set do turn off
    
    	* facing direction of player jet = 16
    	+ direction target of player jet < 16
    	+ player jet: do turn is on
    		player jet : Set facing direction to 12
    		 player jet : Set do turn off
    
    	// facing 20
    
    	* facing direction of player jet = 20
    	+ direction target of player jet >= 24
    	+ player jet: do turn is on
    	  OR
    	* facing direction of player jet = 20
    	+ direction target of player jet <= 4
    	+ player jet: do turn is on
    		player jet : Add 4 to facing direction
    		 player jet : Set do turn off
    
    	* facing direction of player jet = 20
    	+ direction target of player jet < 20
    	+ player jet: do turn is on
    		player jet : Set facing direction to 16
    		 player jet : Set do turn off
    
    	// facing 24
    
    	* facing direction of player jet = 24
    	+ direction target of player jet >= 28
    	+ player jet: do turn is on
    	  OR
    	* facing direction of player jet = 24
    	+ direction target of player jet <= 8
    	+ player jet: do turn is on
    		player jet : Add 4 to facing direction
    		 player jet : Set do turn off
    
    	* facing direction of player jet = 24
    	+ direction target of player jet < 24
    	+ player jet: do turn is on
    		player jet : Set facing direction to 20
    		 player jet : Set do turn off
    
    	// facing 28
    
    	* facing direction of player jet = 28
    	+ direction target of player jet <= 12
    	+ player jet: do turn is on
    		player jet : Add 4 to facing direction
    		 player jet : Set do turn off
    
    	* facing direction of player jet = 28
    	+ direction target of player jet >= 16
    	+ direction target of player jet < 28
    	+ player jet: do turn is on
    		player jet : Set facing direction to 24
    		 player jet : Set do turn off
    
    	// reset flag
    
    	* Always
    		 player jet : Set do turn off
    
    	// fly
    
    	* Repeat while Player 1 Moved top
    	+ NOT Repeat while Player 1 Moved left
    	+ NOT Repeat while Player 1 Moved right
    	+ NOT Repeat while Player 1 Moved down
    		player jet : Set direction target to 8
    
    	* Repeat while Player 1 Moved top
    	+ Repeat while "Left Arrow" is pressed
    	+ NOT Repeat while Player 1 Moved down
    	+ NOT Repeat while Player 1 Moved right
    		player jet : Set direction target to 12
    
    	* Repeat while Player 1 Moved top
    	+ Repeat while Player 1 Moved right
    	+ NOT Repeat while Player 1 Moved down
    	+ NOT Repeat while Player 1 Moved left
    		player jet : Set direction target to 4
    
    	* Repeat while Player 1 Moved right
    	+ NOT Repeat while Player 1 Moved down
    	+ NOT Repeat while Player 1 Moved left
    	+ NOT Repeat while Player 1 Moved top
    		player jet : Set direction target to 0
    
    	* Repeat while Player 1 Moved left
    	+ NOT Repeat while Player 1 Moved down
    	+ NOT Repeat while Player 1 Moved top
    	+ NOT Repeat while Player 1 Moved right
    		player jet : Set direction target to 16
    
    	* Repeat while Player 1 Moved left
    	+ Repeat while Player 1 Moved down
    	+ NOT Repeat while Player 1 Moved top
    	+ NOT Repeat while Player 1 Moved right
    		player jet : Set direction target to 20
    
    	* Repeat while Player 1 Moved right
    	+ Repeat while Player 1 Moved down
    	+ NOT Repeat while Player 1 Moved top
    	+ NOT Repeat while Player 1 Moved left
    		player jet : Set direction target to 28
    
    	* Repeat while Player 1 Moved down
    	+ NOT Repeat while Player 1 Moved top
    	+ NOT Repeat while Player 1 Moved left
    	+ NOT Repeat while Player 1 Moved right
    		player jet : Set direction target to 24
    
    	// SHOOT
    
    	* Player 1 Pressed fire 1
    	+ Number of player bullet < 3
    		New Objects : Create player bullet at (-5,-2) from player jet (action point)
    		player bullet : Set direction to Dir( "player jet" )
    		player bullet : Set speed to 40
    		 player bullet : Bring to back
    
    	* Always
    		player bullet : Add 1 to Alterable Value A
    
    	* Alterable Value A of player bullet >= 40
    		player bullet : Destroy
    
    	* player bullet leaves the play area
    		player bullet : Destroy
    
    	// hits
    
    	* Collision between player bullet and biplane
    		biplane : Destroy
    		player bullet : Destroy
    Nice this code that makes it look like we are programming the example in C plus! (I'll try from scratch based on this!)

  7. #17
    Clicker

    Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)Firefly 3D Module (Steam)

    Join Date
    Jun 2006
    Location
    Killeen, TEXAS
    Posts
    1,087
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    that code is what happens when you copy from fusion; and paste to notepad++ ; this is taken directly from my time pilot version ( same as what you call space pilot )

  8. #18
    Clicker Fusion 2.5 DeveloperiOS Export ModuleUnicode Add-on
    daryuss's Avatar
    Join Date
    Apr 2012
    Location
    Italy
    Posts
    262
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by danjo View Post
    that code is what happens when you copy from fusion; and paste to notepad++ ; this is taken directly from my time pilot version ( same as what you call space pilot )
    Great!
    Howevwer I took the space pilot game as an example because it has the best movement to create games of the genre, and it can also be used for top view driving games (for example you could create a version of The Last V8 arcade, that C = 64 and other clones were too frustrating!).
    But how do you export the event code from ClickTeam fusion to the text file? (Never stop learning !).

  9. #19
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    c4t's Avatar
    Join Date
    Aug 2018
    Posts
    134
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by daryuss View Post
    how do you export the event code from ClickTeam fusion to the text file? (Never stop learning !).
    Choose Edit Select all when in the event editor and then copy. Then paste it into a text file.

  10. #20
    Clicker Fusion 2.5 (Steam)
    Linky's Avatar
    Join Date
    Mar 2020
    Location
    Egypt
    Posts
    155
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by c4t View Post
    Choose Edit Select all when in the event editor and then copy. Then paste it into a text file.
    Note: Only works with Fusion 2.5+ add on

Page 2 of 2 FirstFirst 1 2

Similar Threads

  1. Replies: 3
    Last Post: 27th October 2015, 03:49 PM
  2. Stunt Pilot or Top Dog airplane game movement
    By PeterB in forum The Games Factory 2 - Technical Support
    Replies: 3
    Last Post: 3rd June 2011, 05:26 PM
  3. Space invaders movement
    By Robin_Manager in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 25th August 2008, 03:08 PM

Posting Permissions

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