This site requires JavaScript, please enable it in your browser!
Greenfoot back

Report as inappropriate.

RcCookie
RcCookie presents ...

2021/2/12

Messager

This is my version of a simple messager system using the UserInfo class. You can send other people messages that only they can see (and the author, me).

You can have up to 5 messages sent to others concurrently, after that the oldest one will be deleted. This is a limitation of the UserInfo class.

The system works by storing the messages in the String slots of the sender's UserInfo object. In the integer slots, it stores the hashed target user that should recieve the message, and the time stamp at which the message was sent.
Because the username of the target user has to be hashed (converted to an integer) because of storage limitations, the target user cannot simply be read out. Because of that you may see 'User could not be loaded' in a sent message. Once the other person opened this scenario for at least once the name will show up though.

857 views / 34 in the last 7 days

5 votes | 0 in the last 7 days

Tags: mouse demo with-source communication text online message chat communicate

This scenario is a member of: UNiTy iN NeEd


open in greenfoot
Your browser does not support the canvas tag.
RcCookieRcCookie

2021/2/14

I guess not but try it out
mik.mik.

2021/2/15

Nice!
RcCookieRcCookie

2021/2/15

Thank you!
Roshan123Roshan123

2021/2/19

U got a new inbox Hope u will take some time out to compose And I m shocked to see that no one is voting your scenario Its totally wierd for me
RcCookieRcCookie

2021/2/21

Whatever about the likes. I’m getting like 3-5 on average, I don’t think I can complain
Roshan123Roshan123

2021/3/2

Why the symbol above 'new message' is looking wierd in mobile but not in pc Is it due to my browser version? If not then can u plz explain me
RcCookieRcCookie

2021/3/2

Same on my phone. It’s because the refresh symbol is actually a character from the font, and the font does not seem to be supported on the phone. And the alternative font does not have a character symbol for the refresh char so it shows the classic „no char for that“ char.
Goku555Goku555

2021/5/8

Why some of the letters look half? It not showing full letter. Something like - Cance. I think it is Cancel. By the way it is a very god scenareo. God job
RcCookieRcCookie

2021/5/8

That’s because I am using a custom font. Normally you just say what text you want and Greenfoot figures out the required image size for you, but because you can only draw onto existing images if you want to set the font I have to calculate the size on my own. To do so, I had to measure the size of each character manually, which leads to two problems: - Some special characters may not have been measured and will just get a default size - My measurements are crappy
RcCookieRcCookie

2021/5/8

I may just make each image a bit bigger, but that is not yet fixed. Also, I’m happy you like it!

See all comments

Want to leave a comment? You must first log in.

Who likes this?

rocket770 Game/maniac BogdanMicu mik. Roshan123