トピック
Erry estherrose123

A game I made!

I made a personality test. Check it out! RXCQ33J4 As I mentioned, only the #up button works. If you could, review my code to see what's wrong. Let me know how accurate this is!
3そうだね
プレイ済み
返信[1]
親投稿
Clayton DarkClay88
Put this code in a loop. It's a lot better than what you had before.
0そうだね
プレイ済み
返信[2]
親投稿
Erry estherrose123
I'm pretty sure I tried this before, but I'll double check once I have my 3DS with me(I only have access to miiverse via my pc). Thanks!
0そうだね
プレイ済み
返信[3]
親投稿
Clayton DarkClay88
It works for me.
0そうだね
プレイ済み
返信[4]
親投稿
Oscar PwnageBlock
I recommend the syntax of... REPEAT:UNTIL BUTTON() AND #A It is a very simple code snippet that waits until the A button is pressed. If you wish to keep the button's input, you could do something like... REPEAT B=BUTTON() UNTIL B AND (#A OR #B OR #X OR #Y)
0そうだね
プレイ済み
返信[5]
親投稿
Erry estherrose123
Thanks! what do you think about the game itself?
0そうだね
プレイ済み
返信[6]
親投稿
Oscar PwnageBlock
It's definitely interesting! I think it'd be nice if you could see your own colors after looking at the color descriptions, though.
0そうだね
プレイ済み
返信[7]
親投稿
Sheepy22★∞ SheepSoldier101
It would be nice if you add a pie graph instead of bars.
0そうだね
プレイ済み
返信[8]
親投稿
Erry estherrose123
Oscar- Thanks! I think I'll display it on the other screen. And the code you gave me for the buttons works, so I'll have to do an update anyways. Sheepy- I thought so too but don't know how...
1そうだね
プレイ済み
返信[9]
親投稿
Oscar PwnageBlock
Making a pie chart is actually not too hard! You'll have to draw a circle, and then divide it into segments using lines. The lines can be drawn logically using a bit of trigonometry and a relative sum. You'll have to setup some things first... TOTAL=RED+BLUE+GREEN+YELLOW 'SUM OF ALL COLORS SUM=0 'PERCENTAGE SUM GCIRCLE 200,120,50 'DRAW CIRCLE GLINE 200,120,200,70 'DRAW 1ST LINE
0そうだね
プレイ済み
返信[10]
親投稿
Oscar PwnageBlock
Afterwards, you'll increase the percentage sum by an amount relative to 2*PI (a circumference) and the color in respect to the total. Afterwards, draw a line from the center of the circle to the percentage of circumference that corresponds to the division. We can get this value using simple trigonometry. You can also use a similar value to paint in the division. (Code in next comment)
0そうだね
プレイ済み
返信[11]
親投稿
Oscar PwnageBlock
INC SUM,2*PI()*RED/TOTAL 'INCREMENT THE PERCENTAGE SUM GLINE 200,120,200+50*SIN(SUM),120-50*COS(SUM) 'DRAW DIVISION LINE ANG=SUM-PI()*RED/TOTAL 'AUXILIARY ANGLE FOR PAINTING GPAINT 200+45*SIN(ANG),120-45*COS(ANG),#RED 'PAINT IN DIVISION You can then simply repeat this above code for every color, replacing RED with the appropriate color.
0そうだね
プレイ済み
返信[12]
親投稿
Erry estherrose123
thanks!
1そうだね
プレイ済み
返信[13]
親投稿
Erry estherrose123
This code sounds so confusing to me. We never learnt trig in school, the highest level of math was Algebra 1. I would never be able to do it w/o your help!
0そうだね
プレイ済み
返信[14]
親投稿
Oscar PwnageBlock
Circular geometric logic can be pretty confusing if you've never learned trigonometry, but if you need help you can always ask!
0そうだね
プレイ済み
返信[15]
親投稿
Javier olakease000
Wow.
0そうだね
プレイ済み
返信[16]
親投稿
Erry estherrose123
Being that I didn't understand a word of the code you gave me, I copied it, as you can see in the screenshot. But it's not working.The circle and segments draw, but the color isn't filled in correctly, the yellow just fills the entire screen. Can you please help me out?
0そうだね
プレイ済み
返信[17]
親投稿
Oscar PwnageBlock
What color is the background you're drawing on? If it's white, you might want to write GCOLOR #BLACK before the pie chart code to set the default drawing color to something visible.
0そうだね
プレイ済み
返信[18]
親投稿
Erry estherrose123
Here's what happens.
0そうだね
プレイ済み
返信[19]
親投稿
Erry estherrose123
Strange thing: I copied the entire thing and pasted it to display on the touch screen while the speech about the personality types are on the touch screen, and after scrolling thru all the colors, the pie finally appears as it should.
0そうだね
プレイ済み
返信[20]
親投稿
Oscar PwnageBlock
You probably had a white background when drawing the pie chart, which meant that the circle and divisions weren't being drawn properly. A background color other than white will make it work. You could also specify <GCOLOR #BLACK> before the pie chart code or append <,#BLACK> to every graphics instruction that doesn't already specify color.
0そうだね
プレイ済み
返信[21]
親投稿
Erry estherrose123
It works! Thanks
0そうだね
プレイ済み
返信[22]
親投稿
Erry estherrose123
One more question: when I display the pie graph on the touch screen, it's not centered. How do I center it?
0そうだね
プレイ済み
返信[23]
親投稿
Javier olakease000
The center of Touch Screen is (160,120), so you could center the circle X and Y coordinates and center the start point of lines. ˙˘˙
0そうだね
プレイ済み
返信[24]
親投稿
Oscar PwnageBlock
As Xavier said, you must change all center coordinates to that of the touch screen. That includes the circle, as well as all line and paint coordinates/offsets.
0そうだね
プレイ済み
返信[25]
親投稿
Erry estherrose123
Here's the updated version! It's the one that's highlighted. You can check out 'multiplication' too, it's a cute quiz with random multiplication examples I made for my 3'rd grade sis. You'll have too download 'my sprites' to the same file to see the graphics.
0そうだね
プレイ済み
返信[26]
親投稿
Erry estherrose123
Sorry here's the screenshot
0そうだね
プレイ済み
返信[27]
親投稿
NayNay NayNay505
Do you still have the problem with the buttons? (only up button works?) I can help I that is still the case
0そうだね
プレイ済み
返信[28]
親投稿
Erry estherrose123
nope! it's all fixed now. Thanks for offering anyways.
0そうだね
プレイ済み
返信[29]
親投稿
NayNay NayNay505
No problem :D
0そうだね
プレイ済み