Tayrawr
Full Member
[M:300]
;)
Posts: 169
|
Post by Tayrawr on Sept 29, 2008 20:59:25 GMT -5
I'm a new scripter and i tried to make one for when you press space it sends a bullet towards your mouse for my tds game. I tried like on spacebar pressed create a moving instance of the object at position mouse_x and y but apparantly that wont work, or i'm missing something...if anyone could post one for me, that'd be great
|
|
|
Post by qnp-ʇ on Sept 29, 2008 21:17:17 GMT -5
in the create event of the bullet put:
move_towards_point(mouse_x,mouse_y,3) and then in the thing that shoots the bullet put this in the step event:
if keyboard_check(vk_space) { instance_create(x,y,object) }
and replace object with the name of the bullet object
|
|
Tayrawr
Full Member
[M:300]
;)
Posts: 169
|
Post by Tayrawr on Sept 29, 2008 21:28:15 GMT -5
Thank you, but i needed it to shoot only on spacebar press, instead of like rapidfire, and also another question, i used your look at mouse script for my turret in my game, and it looks slightly to the left of it....but thats not really an issue right now. also i was wondering if you knew how to shoot it out of the barrel instead of out of the turret itself...although i think i already know how to fix that so if you can help with any of this that'd be great thanks.
|
|
|
Post by qnp-ʇ on Sept 29, 2008 21:47:50 GMT -5
if you can send the sprite you are using I will work on a shooting script for you
and if you dont want rapid fire instead of using keyboard_check(vk_space) use
keyboard_check_pressed(vk_space)
|
|
Tayrawr
Full Member
[M:300]
;)
Posts: 169
|
Post by Tayrawr on Sept 29, 2008 22:29:26 GMT -5
|
|
|
Post by qnp-ʇ on Sept 30, 2008 15:35:17 GMT -5
|
|
Tayrawr
Full Member
[M:300]
;)
Posts: 169
|
Post by Tayrawr on Sept 30, 2008 15:42:54 GMT -5
Wow t-dub! this is perfect! if theres anything you ever, dont be afraid to ask.
|
|
|
Post by qnp-ʇ on Sept 30, 2008 15:56:54 GMT -5
glad its what you wanted if you need anyother help feel free to pm me
|
|