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.

1248 views / 7 in the last 7 days

7 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/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!
Gabe1098Gabe1098

2021/6/15

I really like this
RcCookieRcCookie

2021/6/17

Thanks a lot!
Nice work!
RcCookieRcCookie

2021/6/19

Thanks! (Didn’t recieve a message from you ;-) )
Hope now u got my message
Goku555Goku555

2021/7/18

Hi

See all comments

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

Who likes this?

Greenfoot_Admin Gabe1098 rocket770 Game/maniac BogdanMicu mik. Roshan123