Shooting left and right in a platform game
quinn221
Member Posts: 280
Hi,
I have been searching the forums and trying out different solutions to to make my actor shoot left and right. I am using Jamie Cross's Platform Construction kit, and I am just trying to add in a shoot button and action. I am on my 4th hour of trying different methods. Has anyone use this kit before...or can anyone point me in the direction in how to do this. here is the link o the general move behaviors... not sure how and when to put in the new shooting command. Any help would be awesome!
Comments
@quinn221, in that kit there is a Game Level Attribute named Move. It is already keeping track of the direction the character is moving Left or Right you could use this to shoot in the correct direction when a button is pressed. For example:
Rule: When a button is pressed AND game.move=left
Do: the shoot left stuff
Rule: When a button is pressed AND game.move=right
Do: the shoot right stuff
That is clearly not actual code, but hopefully it steers you in the correct direction.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
thanks Jamie...I will give it a shot!
OK... 3 hours later... I have the shoot left and right working on the keyboard...and maybe the touch, but I have not been able to get the viewer to work and I cant place my mouse on both touch buttons.
But, I have one last problem that I need assistance with. I am not able to get my character to shoot standing still... it only work while moving.
I probably set this up as a complete hack and I am sure their are better ways.
but the link below will take you to a folder that will contain my rules....
I am out of Ideas, so any help would be awesome.
Jamie, I am ording your book and online course this weekend... but until then anyway you could help me solve this.
Thankshttps://dropbox.com/s/p3bsmjt1ge00etz/rules.zip?dl=0
@quinn221, Thanks for the support and purchases, I hope you enjoy both the book and the class!
I've attached an edited version of the kit to this message, of course its not the full kit since I can't post that for free download. This version has just the player that can now shoot. You can use either the Command key or the new white square button on screen to shoot in the direction the player is facing. I've put some notes in the player actor to describe what I've done to enable shooting. Hope it helps!
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
Thank you so much!!! going to buy the class today!
works great! thanks again
@quinn221, great! Glad it's working for you. You're welcome.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
@jamie_c I just sent you a message to your message box on the forum, just wanted to give you a heads up in case you never check it.