How to make a cow game piece in matlab

조회 수: 2 (최근 30일)
Megan Harner
Megan Harner 2018년 11월 9일
답변: Walter Roberson 2018년 11월 10일
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
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
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);

카테고리

Help CenterFile Exchange에서 Just for fun에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by