Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / Cool code for clicking the mouse and moving it!!!!!!!!!!!

Author
Message
Gamer Making
18
Years of Service
User Offline
Joined: 20th Sep 2006
Location: sitting at the comp programming
Posted: 23rd Oct 2006 23:19
anybody seen this before? answer yes or no.




sync on
sync rate 20
do
cls
if mouseclick()>0
print "you are clicking the mouse"
endif
sync
if mousemovex()>0 or mousemovey()>0
print "you are clicking the mouse"
endif
sync
loop

Bach Tran
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 23rd Oct 2006 23:54
Yes.

Gamer Making
18
Years of Service
User Offline
Joined: 20th Sep 2006
Location: sitting at the comp programming
Posted: 24th Oct 2006 02:00
Also you can edit this code and many other things

Bach Tran
Xenocythe
19
Years of Service
User Offline
Joined: 26th May 2005
Location: You Essay.
Posted: 24th Oct 2006 05:16
uhh

Don't we already know when we are clicking and moving the mouse?


Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 25th Oct 2006 11:13
Quote: "
if mousemovex()>0 or mousemovey()>0
print "you are clicking the mouse"
endif
"


Are you sure about that?

TEH_CODERER
21
Years of Service
User Offline
Joined: 12th Nov 2003
Location: Right behind you!
Posted: 25th Oct 2006 22:38 Edited at: 25th Oct 2006 22:39
Yeah, 'moving' would seem a better choice of word. Also, why are you using 'cls' and two 'sync's?

Gamer Making
18
Years of Service
User Offline
Joined: 20th Sep 2006
Location: sitting at the comp programming
Posted: 26th Oct 2006 23:27
opps wrong thing.

Bach Tran
Gamer Making
18
Years of Service
User Offline
Joined: 20th Sep 2006
Location: sitting at the comp programming
Posted: 26th Oct 2006 23:34
Xenocythe you know im a beginner and those are one of the codes I can make. Im not a pro that writes games or something.

Bach Tran
Kohaku
20
Years of Service
User Offline
Joined: 3rd May 2004
Location: The not very United Kingdom
Posted: 27th Oct 2006 15:41 Edited at: 27th Oct 2006 16:05
If you're going to make a crapplication then you should put some effort into it. Observe:




You are not alone.
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 28th Oct 2006 14:00 Edited at: 28th Oct 2006 14:02
@Kohaku: You know that Gamer Making is new so if you don't have anything encouraging or constructive to say about his work then don't say anything at all.

@Gamer Making: I have seen this before, but there was a time when I really could have used this. It should help some other newcomers looking to learn the mouse commands. All you need to do is fix that "you are clicking the mouse" thing it says when you move the mouse and remove the extra sync in the middle of the loop and you should be all set.

Ummm...
Kohaku
20
Years of Service
User Offline
Joined: 3rd May 2004
Location: The not very United Kingdom
Posted: 28th Oct 2006 18:23 Edited at: 28th Oct 2006 18:25
Actually I don't know Game Making at all and to rely on join dates when so many people make new accounts would be wrong. Plus my seemingly evil comments were really retracted by my code and its comic theme.

I was really expecting somebody with a sense of humour to laugh at my post, but meh, I no longer care. I spent about an hour on it though.

The only insult that I could find in my post was the 'put some effort into it' remark. In my defence, "you are clicking the mouse". Perhaps craplication could be taken as an insult too, implying that the said application is crap. That however is also undeniably valid.

I do apologize for being so darn mean though. Not my usual way at all. Must be the long week of screwing about with a website getting to me.

You should report my message as being abusive. I deserve that one.


You are not alone.
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 28th Oct 2006 19:59
@Game-Making,
I'll try to explain why everyone attacked you.
1. Your code only demonstrates a command that anyone could figure out by simple reading the manual.
2. The "you are clicking" message also shows that you really don't understand the code yet yourself. (or it was just a simple mistake of copy n paste and it got overlooked, I don't know)
3. And the code is written inefficiently by using the extra sync. And in this example, you really don't even need to use the sync commands.

Understand what you're writing before you post code to help others. Because if something isn't accurate in the code, then its not helping anyone else to learn from.

We're here to help! (mostly)

Also, when you post code, please use the CODE tags so that the code displays properly with indentations. You do indent the code don't you?

So, before posting code snippets do the following:
- keep code indented and clean-looking (no spaghetti code)
- scan over the code for errors and accuracy
- ask yourself, is this useful?

Any questions or help needed, my contact info should be displayed. You just might be the person I need to help write a set of beginner tutorials for DB. Because when someone like myself has been doing programming for years with different languages, sometimes it's hard for us to explain the simple commands because we just disregard them as standard knowledge. An example would be: "oh, you don't know how to display text on a screen yet? I thought everyone did." So you could be my test subject (mwahahahaha) in making sure that I explain everything clearly in the tutorials.

"Using Unix is the computing equivalent of listening only to music by David Cassidy" - Rob Pike
whipped6
18
Years of Service
User Offline
Joined: 31st Aug 2006
Location:
Posted: 29th Oct 2006 18:35
well game making i seen some of your fewer posts and i see you are a beginner so am I lol and i would like to work with u on programming like (learning togather) we would get much farther i can teach u what i know to... if you have msn or hotmail just add me my email adress is whippedknight5@msn.com

here is a code to move a sprite if it helps


that might need a little editing on the sprite 1, mousex(),mousey() because i just made that code up right now i hope it helps

game creator
Gamer Making
18
Years of Service
User Offline
Joined: 20th Sep 2006
Location: sitting at the comp programming
Posted: 30th Oct 2006 02:44
thanks guys!

Bach Tran
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 26th Nov 2006 05:19
I would like to add to Phaelax's comments - agreeing wholeheartedly with what he said.

It seems that it's not clear to newcomers what the code snippets board is actually for.

If you look on the forum main page you will see that the description for this board says "This is the famous Code Snippets board! Post your code here for others to benefit from."

It does not say "Post any old tat here".

The key word is 'benefit' and the idea is for experienced coders to post snippets which newcomers (and others) can benefit from.

Newcomers shouldn't even be posting stuff on here - even less so if they don't even understand what they are actually posting.

Unfortunately, if you read through the posts on here, there are far, far too many useless snippets which educate no-one.

I'm not aiming this at Gamer Making or anyone else in particular and I'm not flaming noobs - you will be experienced soon enough to make a worthwhile contribution to the snippets board.

But posting worthless snippets on here is devaluing the good stuff which is getting increasingly difficult to find in all the dross.

TDK_Man

Kohaku
20
Years of Service
User Offline
Joined: 3rd May 2004
Location: The not very United Kingdom
Posted: 27th Nov 2006 03:05
I remember my first post on this board. It was a snippet for sliding collision in DBC, which I later converted to DBP. It even got in the newsletter.

I was quite proud of the said function when I originally made it, as methods for sliding collision were very hard for me to grasp. When I eventually made it and stuck it in my RPG, I was uber happy with it. Noticing that collision was bugging other people too, I decided to post it as I thought others could benefit from it as much as I had.

I was going to make a general point to this story but I'm suddenly very tired, so I'll say good night instead.

Happy coding!


You are not alone.
harggood
21
Years of Service
User Offline
Joined: 9th Apr 2003
Location: the forest
Posted: 30th Nov 2006 22:47
Gamer Making - This is your forum too. The mean people just want you to know how clever they are. You don't have to be an expert to enjoy yourself or to share your enjoyment with others.

Awfuldark Forest

Login to post a reply

Server time is: 2024-11-22 23:04:16
Your offset time is: 2024-11-22 23:04:16