| We hope you enjoy your visit. You're currently viewing the Ultimate 3D Community as a guest. This means that you can only read posts, but can not create posts or topics by yourself. To be able to post you need to register. Then you can participate in the community active and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free. Join our community! If you are already a member please log in to your account to access all of our features: |
| making game with guns!!!; putting and using guns into game | |
|---|---|
| Tweet Topic Started: Nov 22 2010, 12:53 AM (321 Views) | |
| joihnsonlee | Nov 22 2010, 12:53 AM Post #1 |
|
Advanced Member
![]() ![]() ![]() ![]() ![]()
|
how do i put a 2d gun in the screen (like doom 2 when u are using a gun) with target. also how do i make my gun shoot (slow travelling) bullets (quake 2's starting weapon) ps please tell which code goes with which object and which event. or tell me where i can find an example which can do all of it. |
![]() |
|
| RonBurgundy | Nov 22 2010, 02:52 AM Post #2 |
|
Forum Borat
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
for a 2d gun use DrawTex in Draw for control object to make bullets do something like char object step: if MouseCheckButton(mb_left) = 1 { if ! instance_exists(bullet) instance_create(x,y,bullet) } bullet step: rotx=camera.rotx roty=camera.roty Move(camera.rotx,camera.roty,10) Edited by RonBurgundy, Nov 22 2010, 02:53 AM.
|
| !!! DEFEND POP PUNK !!! | |
![]() |
|
| joihnsonlee | Nov 22 2010, 03:10 AM Post #3 |
|
Advanced Member
![]() ![]() ![]() ![]() ![]()
|
sorry can u tell in more detail where DrawTex is? and is all the code u shown are in the charater object? or is bullet step in another object? |
![]() |
|
| RonBurgundy | Nov 22 2010, 03:20 AM Post #4 |
|
Forum Borat
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
DrawTex goes in the control's draw event but you'll need to set up a texture to use first using LoadTexture have a look at the documentation for more info for those two. only the 1st part of that code goes in the char object step event the second part goes in the bullet step event. |
| !!! DEFEND POP PUNK !!! | |
![]() |
|
| joihnsonlee | Nov 22 2010, 04:07 AM Post #5 |
|
Advanced Member
![]() ![]() ![]() ![]() ![]()
|
i feel a bit lazy. i must i make a texture? looks difficult. can't i use a sprite instead (the game maker tutorial way). if i must use textures which pages must i read? or if u feel friendly can u tell in short how to do it (texture or game maker tutorial method)? |
![]() |
|
| RonBurgundy | Nov 22 2010, 04:43 AM Post #6 |
|
Forum Borat
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
lol tell you what I'll make an exampe for you possibly tomorrow kay? |
| !!! DEFEND POP PUNK !!! | |
![]() |
|
| Despellanion | Nov 22 2010, 11:23 AM Post #7 |
|
Forum God
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Geez. Edited by Despellanion, Nov 22 2010, 04:47 PM.
|
![]() |
|
| joihnsonlee | Nov 22 2010, 05:03 PM Post #8 |
|
Advanced Member
![]() ![]() ![]() ![]() ![]()
|
thanks (if u are not pulling my leg and actually do it.) and again many thanks!!!! |
![]() |
|
| RonBurgundy | Nov 22 2010, 09:58 PM Post #9 |
|
Forum Borat
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
wow, i'll do it okay dayummmmmmm. look for it later tonite, luckily you caught me in a good mood.
|
| !!! DEFEND POP PUNK !!! | |
![]() |
|
| RonBurgundy | Nov 23 2010, 12:08 AM Post #10 |
|
Forum Borat
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Okay Here ya go!
|
| !!! DEFEND POP PUNK !!! | |
![]() |
|
| joihnsonlee | Nov 23 2010, 12:49 AM Post #11 |
|
Advanced Member
![]() ![]() ![]() ![]() ![]()
|
thank u!!!! |
![]() |
|
| joihnsonlee | Nov 23 2010, 01:11 AM Post #12 |
|
Advanced Member
![]() ![]() ![]() ![]() ![]()
|
how do i switch weapons because at the moment i can only use one. because i don't know how to put an event (draw) inside another event (press 1 or 2 "press keyboard button") (if that makes sense) and yes i have a texture. if only there was way that i can press "1" which will equip (draw) one weapon and press "2" to switch with (draw) another weapon. Edited by joihnsonlee, Nov 23 2010, 01:44 AM.
|
![]() |
|
| Monty | Nov 23 2010, 01:51 AM Post #13 |
|
Forum Leader
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
This isn't really U3D related at all. Make a variable for the current gun (current_gun) that holds a number, which can be switched using the keyboard press events. In the draw event, you do:
or if you're feeling fancy:
They're the same exact thing btw. But this is all basic GML. If you don't feel comfortable with GML you can always use the action library of U3D to make things easier (but much more limited). Edited by Monty, Nov 23 2010, 01:53 AM.
|
![]() |
|
| Despellanion | Nov 23 2010, 08:29 AM Post #14 |
|
Forum God
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Might I suggest to learn basic programming before attempting to do advanced 3d games? You won't get anywhere doing it like this, having other people program the game for you. Edited by Despellanion, Nov 23 2010, 08:30 AM.
|
![]() |
|
| « Previous Topic · Questions about Ultimate 3D · Next Topic » |





![]](http://z1.ifrm.com/static/1/pip_r.png)



bulletexample.zip (881.96 KB)
9:12 PM Jul 11