How to make a cow game piece in matlab
조회 수: 2 (최근 30일)
이전 댓글 표시
I am currently trying to make a version of connect four but cow themed. I want to make the 'chip' pieces that you drop into the game into cows. I don't mind what the cow looks like I just need to know how to create it.
댓글 수: 1
Geoff Hayes
2018년 11월 10일
Megan - what are you using to represent the board for the game? Are you using a figure with an axes or are you using an image that you will continuously update with the game pieces? Please provide more details.
답변 (1개)
Walter Roberson
2018년 11월 10일
If you use an image then when you call image() you can pass in coordinates to place the image at. For example, assuming you reserve 50 pixels by 50 pixels per piece,
user_row = 17; user_col = 9;
x_base = (user_col - 1) * 50 + 5;
y_base = (user_row - 1) * 50 + 5;
image([x_base x_base+40], [y_base, y_base+40], brown_cow);
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!