Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Beginning game programming course  (Read 63480 times)

0 Members and 1 Guest are viewing this topic.

lordnacho

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 509
  • Last login:January 21, 2023, 07:38:14 pm
Re: Beginning game programming course
« Reply #240 on: March 08, 2015, 10:54:49 pm »
Right off, I'm not feeling this assignment.  Too similar to the last one and forcing bad design on us

Agreed, although I think it's largely a consequence of trying to introduce things in the order the course is structured.
Seems a bit all over the place what he's trying to introduce though.  The lessons were about strings and if statements, but the assignment is filling in a lot of random stuff in his hodgepodge code.  Feel like this assignment is going to confuse a lot of people. 

lordnacho

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 509
  • Last login:January 21, 2023, 07:38:14 pm
Re: Beginning game programming course
« Reply #241 on: March 08, 2015, 11:21:42 pm »
Submitted assignment 3. 
First attempt, I had all 3 rocks generating at the same time, over and over.  Guess my fault for not reading the comments fully.

JDFan

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3448
  • Last login:March 03, 2025, 10:29:54 am
  • I want to build my own arcade controls!
Re: Beginning game programming course
« Reply #242 on: March 09, 2015, 12:10:10 am »
Seems a bit all over the place what he's trying to introduce though.  The lessons were about strings and if statements, but the assignment is filling in a lot of random stuff in his hodgepodge code.  Feel like this assignment is going to confuse a lot of people.

Yes but he is making us use if statements to complete the hodgepodge code instead of using other methods.

Submitted assignment 3. 
First attempt, I had all 3 rocks generating at the same time, over and over.  Guess my fault for not reading the comments fully.
Mine had the first rock OK but then was drawing the second and third together rather than one at a time also and since they were leaving the window together kept looping that way - but now all is fine after going back and changing a few things.

shponglefan

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1600
  • Last login:December 15, 2022, 07:22:35 am
  • Correct horse battery staple
Re: Beginning game programming course
« Reply #243 on: March 09, 2015, 11:51:31 am »
Right off, I'm not feeling this assignment.  Too similar to the last one and forcing bad design on us

Agreed, although I think it's largely a consequence of trying to introduce things in the order the course is structured.
Seems a bit all over the place what he's trying to introduce though.  The lessons were about strings and if statements, but the assignment is filling in a lot of random stuff in his hodgepodge code.  Feel like this assignment is going to confuse a lot of people.

For sure.  I'm surprised they don't have a more gradual approach building console applications and learning all the underlying programming logic first (i.e. performing comparisons, iteration, OOP, etc.).  Then after that jump into XNA and graphics.

But maybe that wouldn't hold people's interest to the same level?

eds1275

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2165
  • Last login:June 13, 2025, 11:04:26 am
  • Rock and Roll!
Re: Beginning game programming course
« Reply #244 on: March 09, 2015, 12:38:05 pm »
I just read my evaluations from Assignment 1. Well, no... I just saw 5 spots saying [This area was left blank by the evaluator.] That's pretty lame! I also lost marks due to adding code that said you blew up if the shell didn't get far enough away from you.

Generic Eric

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4520
  • Last login:July 15, 2024, 09:18:25 pm
  • Restore! Don't maim for MAME, build from scratch!
    • forum.arcadecontrols.com/index.php/topic,143226.0.html
Re: Beginning game programming course
« Reply #245 on: March 09, 2015, 12:52:27 pm »
I just read my evaluations from Assignment 1. Well, no... I just saw 5 spots saying [This area was left blank by the evaluator.] That's pretty lame! I also lost marks due to adding code that said you blew up if the shell didn't get far enough away from you.

I added code that give displayed the answer based on the user input and then the correct answer.  I was marked down because of that.  Another evaluator liked that I did that.

Probably the key is not to add any frills.

I also had  someone leave no marks too. 

shponglefan

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1600
  • Last login:December 15, 2022, 07:22:35 am
  • Correct horse battery staple
Re: Beginning game programming course
« Reply #246 on: March 09, 2015, 12:59:26 pm »
The joys of peer evaluation with inexperienced people doing the marking.  :P

DaOld Man

  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5158
  • Last login:May 24, 2025, 09:57:44 pm
  • Wheres my coffee?
    • Skenny's Outpost
Re: Beginning game programming course
« Reply #247 on: March 09, 2015, 01:25:53 pm »
I think I got high marks from everyone, with two comments left. One comment said I added too many additional comments. Sorry, I always thought it was good practice to leave as many comments in your code, explaining it to others, as long as you didn't put a lot of bull crap in them.
I did the same thing on assignment two, so that guy, if he sees mine, will probably give me a lower grade due to "not listening to him the first time". LOL

Vigo

  • the Scourage of Carpathia
  • Global Moderator
  • Trade Count: (+24)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 6417
  • Last login:June 05, 2025, 05:38:45 pm
Re: Beginning game programming course
« Reply #248 on: March 09, 2015, 01:32:50 pm »
I had one evaluation complain about the format of the premade physics formulas that I copied and pasted from the assignment. Appraently I needed to improve up on them. Another review just liked that I wrote "KABOOM!"  :lol

Generic Eric

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4520
  • Last login:July 15, 2024, 09:18:25 pm
  • Restore! Don't maim for MAME, build from scratch!
    • forum.arcadecontrols.com/index.php/topic,143226.0.html
Re: Beginning game programming course
« Reply #249 on: March 09, 2015, 02:29:54 pm »
The joys of peer evaluation with inexperienced people doing the marking.  :P
That is where I am.

As easy as it might have been for others, I totally missed the boat.  I used my jpgs, changed out what I thought was relevant regarding the jpgs, copied the first evaluation assignment, and it doesn't go.  I looked at the forum and found something about changing Programming cs, but it still crashes.

Is there a chance I missed something when I set up the environment?

Vigo

  • the Scourage of Carpathia
  • Global Moderator
  • Trade Count: (+24)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 6417
  • Last login:June 05, 2025, 05:38:45 pm
Re: Beginning game programming course
« Reply #250 on: March 09, 2015, 03:12:42 pm »
Mine was crashing when I had a character wrong on a image I was referencing during assignment 2. I had robot1.png, robot2.png and robot3.png. My code was calling robot0, robot1 and robot2. I didn't have a robot0.png. Boom! Crash.

lordnacho

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 509
  • Last login:January 21, 2023, 07:38:14 pm
Re: Beginning game programming course
« Reply #251 on: March 09, 2015, 03:17:02 pm »
The joys of peer evaluation with inexperienced people doing the marking.  :P
That is where I am.

As easy as it might have been for others, I totally missed the boat.  I used my jpgs, changed out what I thought was relevant regarding the jpgs, copied the first evaluation assignment, and it doesn't go.  I looked at the forum and found something about changing Programming cs, but it still crashes.

Is there a chance I missed something when I set up the environment?
Post your code maybe we can take a look

Generic Eric

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4520
  • Last login:July 15, 2024, 09:18:25 pm
  • Restore! Don't maim for MAME, build from scratch!
    • forum.arcadecontrols.com/index.php/topic,143226.0.html
Re: Beginning game programming course
« Reply #252 on: March 09, 2015, 03:25:18 pm »
The joys of peer evaluation with inexperienced people doing the marking.  :P
That is where I am.

As easy as it might have been for others, I totally missed the boat.  I used my jpgs, changed out what I thought was relevant regarding the jpgs, copied the first evaluation assignment, and it doesn't go.  I looked at the forum and found something about changing Programming cs, but it still crashes.

Is there a chance I missed something when I set up the environment?
Post your code maybe we can take a look

I've looked through 3 of the  submissions I'm supposed to grade.  They all crash, that is what makes me wonder if it isn't my install.

lordnacho

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 509
  • Last login:January 21, 2023, 07:38:14 pm
Re: Beginning game programming course
« Reply #253 on: March 09, 2015, 03:42:48 pm »
What IDE?  I had trouble setting up XNA in Visual Studio 2013, was because I didn't have the newest update.  But it's not in Windows Update, have to do it in VS.

Generic Eric

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4520
  • Last login:July 15, 2024, 09:18:25 pm
  • Restore! Don't maim for MAME, build from scratch!
    • forum.arcadecontrols.com/index.php/topic,143226.0.html
Re: Beginning game programming course
« Reply #254 on: March 09, 2015, 04:45:15 pm »
What IDE?  I had trouble setting up XNA in Visual Studio 2013, was because I didn't have the newest update.  But it's not in Windows Update, have to do it in VS.



SWEET!

I've been trying one more thing for like 2 hours.  I finally figured what I was doing.  You fellas helped!  Thanks. 

I won't get credit, but I can feel better that I know where to put things and that I can evaluate the coding knowing that I have things set up correctly.

shponglefan

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1600
  • Last login:December 15, 2022, 07:22:35 am
  • Correct horse battery staple
Re: Beginning game programming course
« Reply #255 on: March 09, 2015, 06:28:41 pm »
Woo-hoo!  Glad you got it working!   :applaud:

DaOld Man

  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5158
  • Last login:May 24, 2025, 09:57:44 pm
  • Wheres my coffee?
    • Skenny's Outpost
Re: Beginning game programming course
« Reply #256 on: March 09, 2015, 08:05:12 pm »
Congrats on getting it, Generic Eric!

I have mixed feelings about watching the lecture videos before diving into the assignment.
It doesn't seem like the stuff he goes over has a lot to do with what we have to build in the assignment.
But the forum is a good tool to help figure stuff out, plus this thread on here is a good thing.

DaOld Man

  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5158
  • Last login:May 24, 2025, 09:57:44 pm
  • Wheres my coffee?
    • Skenny's Outpost
Re: Beginning game programming course
« Reply #257 on: March 09, 2015, 08:07:58 pm »
On a side note, there is another class on programming in Perl that starts in June. (Same site, different instructor)
Don't know though if I would have time to do that when the weather is nice and warm.

Generic Eric

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4520
  • Last login:July 15, 2024, 09:18:25 pm
  • Restore! Don't maim for MAME, build from scratch!
    • forum.arcadecontrols.com/index.php/topic,143226.0.html
Re: Beginning game programming course
« Reply #258 on: March 09, 2015, 08:40:09 pm »
Thanks fellas!

@daold man
Now that you mention it, its probably worthwhile to have an idea what the assignment is.

Is everyone in for week3?

yotsuya

  • Trade Count: (+21)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19959
  • Last login:June 16, 2025, 05:43:24 pm
  • 2014 UCA Winner, 2014, 2015, 2016 ZapCon Winner
    • forum.arcadecontrols.com/index.php/topic,137636.msg1420628.html
Re: Beginning game programming course
« Reply #259 on: March 09, 2015, 09:35:43 pm »
I ended up withdrawing. I wasn't able do the lectures before week 2, and since I can't submit it now, oh well. I'm still going to follow you guys and tinker,  but these two weeks just are too busy for me.
***Build what you dig, bro. Build what you dig.***

shponglefan

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1600
  • Last login:December 15, 2022, 07:22:35 am
  • Correct horse battery staple
Re: Beginning game programming course
« Reply #260 on: March 09, 2015, 09:47:22 pm »
Assignment 3 experimentation continues, this time with collision detection.  I started by reflecting the rocks off the borders rather than disappearing them. Then I wanted them to bounce off each other.  Collision detection itself was easy (Rectangle.Intersects(Rectangle) method), but handling direction changes was a challenge.  It took four attempts to finally find a method that works and was relatively 'clean'.

And then I added a few more rocks.  ;D






JDFan

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3448
  • Last login:March 03, 2025, 10:29:54 am
  • I want to build my own arcade controls!
Re: Beginning game programming course
« Reply #261 on: March 09, 2015, 09:56:46 pm »
Interesting -- Maybe now remove the rock and run an explosion animation  - that runs once they collide 10 or 20 times with another rock .
« Last Edit: March 09, 2015, 09:58:19 pm by JDFan »

shponglefan

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1600
  • Last login:December 15, 2022, 07:22:35 am
  • Correct horse battery staple
Re: Beginning game programming course
« Reply #262 on: March 09, 2015, 10:12:13 pm »
Interesting -- Maybe now remove the rock and run an explosion animation  - that runs once they collide 10 or 20 times with another rock .

Great idea!  ;D

Tomorrow I'll give that a go.  I've been wanting to figure out how to do proper animations.

JDFan

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3448
  • Last login:March 03, 2025, 10:29:54 am
  • I want to build my own arcade controls!
Re: Beginning game programming course
« Reply #263 on: March 09, 2015, 10:22:39 pm »
Interesting -- Maybe now remove the rock and run an explosion animation  - that runs once they collide 10 or 20 times with another rock .

Great idea!  ;D

Tomorrow I'll give that a go.  I've been wanting to figure out how to do proper animations.

Figure the exploding teddybear lab might help. (lab 10 IIRC)

shponglefan

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1600
  • Last login:December 15, 2022, 07:22:35 am
  • Correct horse battery staple
Re: Beginning game programming course
« Reply #264 on: March 09, 2015, 10:49:11 pm »
Interesting -- Maybe now remove the rock and run an explosion animation  - that runs once they collide 10 or 20 times with another rock .

Great idea!  ;D

Tomorrow I'll give that a go.  I've been wanting to figure out how to do proper animations.

Figure the exploding teddybear lab might help. (lab 10 IIRC)

Just downloaded it and was poking through the code.  I hadn't realized it was possible to contain all the animation frames in a single PNG file.  I thought that each frame would need to be its own file, but in hindsight it makes a lot of sense to do it in one file.

That's really cool!  I'm super excited to give this a shot, but I really should go to bed now.  ;D

lordnacho

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 509
  • Last login:January 21, 2023, 07:38:14 pm
Re: Beginning game programming course
« Reply #265 on: March 09, 2015, 11:04:17 pm »
Anyone ever make a sprite sheet before?   I was going to try, but looks so tedious.

Looks like in Unity you can use them but also can break things apart and animate them by key frames.  Like an arm would be it's own object and you can define the paths.  Brings me back to the old days of making Flash animations.

Vigo

  • the Scourage of Carpathia
  • Global Moderator
  • Trade Count: (+24)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 6417
  • Last login:June 05, 2025, 05:38:45 pm
Re: Beginning game programming course
« Reply #266 on: March 09, 2015, 11:35:47 pm »
I ended up withdrawing. I wasn't able do the lectures before week 2, and since I can't submit it now, oh well. I'm still going to follow you guys and tinker,  but these two weeks just are too busy for me.

:( I kinda figured you were too busy. Maybe next round.


Anyone ever make a sprite sheet before?   I was going to try, but looks so tedious.

Looks like in Unity you can use them but also can break things apart and animate them by key frames.  Like an arm would be it's own object and you can define the paths.  Brings me back to the old days of making Flash animations.

I've been making sprites in photoshop. Right now, I am just using multiple layers so that the image lines up with each part of the animation. I can also paste bits from the previous frame that I want to keep the same. I plan to make it into a spritesheet, so I assume I would just be placing them in a grid when done. If I was making a 20X20 sprite with 9 frames, I assume I would just then make a 60X60 image and place the sprite in each slot in a 3 by 3 pattern, or a 1 by 9 pattern of 180X20. I assume we program how the sprites are read on a spritesheet.
« Last Edit: March 09, 2015, 11:38:55 pm by Vigo »

lordnacho

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 509
  • Last login:January 21, 2023, 07:38:14 pm
Re: Beginning game programming course
« Reply #267 on: March 10, 2015, 09:23:31 am »
Yeah pretty sure you can split by whatever dimensions you specify.

I saw this mentioned on a free gaming tools article:
https://www.codeandweb.com/texturepacker
Looks pretty handy, says it can import from a bunch of file formats including psd

lordnacho

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 509
  • Last login:January 21, 2023, 07:38:14 pm
Re: Beginning game programming course
« Reply #268 on: March 10, 2015, 10:50:54 am »
On a side note, there is another class on programming in Perl that starts in June. (Same site, different instructor)
Don't know though if I would have time to do that when the weather is nice and warm.
Got a link to that course?  I don't see it in the search. 
Not sure I'd recommend Perl unless you knew you had a use for it though.  If they had a Python one, I'd suggest that instead.

This one looks interesting, but not sure I'll be able to stick with it
https://www.coursera.org/course/cryptography
« Last Edit: March 10, 2015, 10:52:25 am by lordnacho »

eds1275

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2165
  • Last login:June 13, 2025, 11:04:26 am
  • Rock and Roll!
Re: Beginning game programming course
« Reply #269 on: March 10, 2015, 11:56:47 am »
Anyone ever make a sprite sheet before?   I was going to try, but looks so tedious.

Looks like in Unity you can use them but also can break things apart and animate them by key frames.  Like an arm would be it's own object and you can define the paths.  Brings me back to the old days of making Flash animations.

I have never made sprite sheets but I did make a 2d character using separate pieces that fit together and spat projectiles when I pushed the button. Not only can you animate movement, but scale and size, so I made a pretty slick looking trumpet mouth that patooied nicely. I'll see if I can find it.

DaOld Man

  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5158
  • Last login:May 24, 2025, 09:57:44 pm
  • Wheres my coffee?
    • Skenny's Outpost
Re: Beginning game programming course
« Reply #270 on: March 10, 2015, 12:20:27 pm »
Got a link to that course?  I don't see it in the search. 
Not sure I'd recommend Perl unless you knew you had a use for it though.  If they had a Python one, I'd suggest that instead.

I cant find it now either, but I think my eyes were crooked last night. Im pretty sure the course I saw (at work), was on python, not perl:

https://www.coursera.org/course/pythonlearn

Starts in June (wonderful time of year weather wise in my part of the world).
But there is another one in October, I may sign up for that one, will have to see what I have going on then.
This class we are on now is eating up a lot of my time, more than I thought it would.

shponglefan

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1600
  • Last login:December 15, 2022, 07:22:35 am
  • Correct horse battery staple
Re: Beginning game programming course
« Reply #271 on: March 10, 2015, 12:26:23 pm »
Anyone ever make a sprite sheet before?   I was going to try, but looks so tedious.

Looks like in Unity you can use them but also can break things apart and animate them by key frames.  Like an arm would be it's own object and you can define the paths.  Brings me back to the old days of making Flash animations.

Back in the day I did for map tiles, but not specifically for character animation.  I imagine it wouldn't be too difficult to animate individual components of a character in XNA.  You'd just need to define multiple sprite textures and associated behaviour as part of your class.

I could see doing this especially for very large game characters (i.e. huge end of level bosses) where it would be impractical to have everything as a single sprite.
« Last Edit: March 10, 2015, 12:27:55 pm by shponglefan »

lordnacho

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 509
  • Last login:January 21, 2023, 07:38:14 pm
Re: Beginning game programming course
« Reply #272 on: March 10, 2015, 01:34:28 pm »
I cant find it now either, but I think my eyes were crooked last night. Im pretty sure the course I saw (at work), was on python, not perl:

https://www.coursera.org/course/pythonlearn

Starts in June (wonderful time of year weather wise in my part of the world).
But there is another one in October, I may sign up for that one, will have to see what I have going on then.
This class we are on now is eating up a lot of my time, more than I thought it would.
Messed up and deleted what I wrote.
I may take this too.  Python seems pretty powerful and fast.  Have used it for simple scripts at work and a couple at home for grabbing mame roms based on hyperspin favorite lists so I could copy the roms to my raspberry pi.


I have never made sprite sheets but I did make a 2d character using separate pieces that fit together and spat projectiles when I pushed the button. Not only can you animate movement, but scale and size, so I made a pretty slick looking trumpet mouth that patooied nicely. I'll see if I can find it.
Ah cool.  Feel like I could hack something together this route vs photoshop and making each frame.  Always wished I had more artistic abilities.

Back in the day I did for map tiles, but not specifically for character animation.  I imagine it wouldn't be too difficult to animate individual components of a character in XNA.  You'd just need to define multiple sprite textures and associated behaviour as part of your class.

I could see doing this especially for very large game characters (i.e. huge end of level bosses) where it would be impractical to have everything as a single sprite.
I'm betting this is what Unity does behind the scenes.  Unity does use C# too.  Will try and see if it generates some code.

Hopefully the class goes into this.   Sprites are cool but I can't imagine how much time it takes.  I looked at the sprite sheets for some simple games like Braid and there were a lot of frames.
« Last Edit: March 10, 2015, 01:36:23 pm by lordnacho »

eds1275

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2165
  • Last login:June 13, 2025, 11:04:26 am
  • Rock and Roll!
Re: Beginning game programming course
« Reply #273 on: March 10, 2015, 03:01:31 pm »
Ah cool.  Feel like I could hack something together this route vs photoshop and making each frame.  Always wished I had more artistic abilities.

Skip to 4:30 to see animating separate parts of this peanut man to see one way to do it in unity!
 http://unity3d.com/learn/tutorials/modules/beginner/2d/2d-overview

lordnacho

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 509
  • Last login:January 21, 2023, 07:38:14 pm
Re: Beginning game programming course
« Reply #274 on: March 11, 2015, 11:50:39 am »
Skip to 4:30 to see animating separate parts of this peanut man to see one way to do it in unity!
 http://unity3d.com/learn/tutorials/modules/beginner/2d/2d-overview
Yeah this was the video that made me switch over and try out Unity. 

Went out and bought a small Wacom tablet.  Hoping to figure the thing out and get some artwork going. 

shponglefan

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1600
  • Last login:December 15, 2022, 07:22:35 am
  • Correct horse battery staple
Re: Beginning game programming course
« Reply #275 on: March 11, 2015, 12:24:18 pm »
Went out and bought a small Wacom tablet.  Hoping to figure the thing out and get some artwork going.

Nice!  Wacom Tablets are very nice tools.  :applaud:

What size did you get?
« Last Edit: March 11, 2015, 12:26:48 pm by shponglefan »

lordnacho

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 509
  • Last login:January 21, 2023, 07:38:14 pm
Re: Beginning game programming course
« Reply #276 on: March 11, 2015, 12:47:59 pm »
Nice!  Wacom Tablets are very nice tools.  :applaud:

What size did you get?
Went with the small pen/touch one, although already turned touch off.  Wanted medium, but not for an extra hundred bucks.
Looked at other brands(like monoprice), and just saw too many mixed reviews.

EssexMame

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 472
  • Last login:May 20, 2025, 09:13:39 am
  • Mame Weekender
Re: Beginning game programming course
« Reply #277 on: March 11, 2015, 12:50:35 pm »
Struggling this week! The stuff learnt in the course (ifs etc) is no problems but passing/using the spriteBatch to Rock.Draw I've not a clue! Is it something made more obvious by owning the book?

JDFan

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3448
  • Last login:March 03, 2025, 10:29:54 am
  • I want to build my own arcade controls!
Re: Beginning game programming course
« Reply #278 on: March 11, 2015, 01:39:57 pm »
Struggling this week! The stuff learnt in the course (ifs etc) is no problems but passing/using the spriteBatch to Rock.Draw I've not a clue! Is it something made more obvious by owning the book?

Since the rock class has the draw function in it you just need to tell the rock to draw itself. so in the game.cs you just need to check whether the rock exists ( is not null ) to keep from crashing the program. and then tell the rock (firstRock or whatever name you used) to draw itself using the draw function of the rock.cs something like :

Code: [Select]
   
             if (firstRock != null)
            {
                firstRock.Draw(spriteBatch);
            }

And then do the same for the other 2 rocks in between the spriteBatch.begin() and end

In the Rock.cs
You just check if the rock is not outsideWindow (ie. it is on the window and needs to be drawn) and if it is then call the draw routine by passing it the variables he declared in the begining of the rock.cs for the variables of the draw routine.
Code: [Select]
   // save sprite and set draw rectangle
            this.sprite = sprite;
            drawRectangle = new Rectangle
and Color.White (since we just want the color of the sprite to be used)

 
so that portion would be something like
Code: [Select]
{
            //-----------------------------------------------------------
            // STUDENTS: Only draw the rock if it's inside the window
            //-----------------------------------------------------------

            if (! OutsideWindow)
            {
                //------------------------------------------------------------------
                // STUDENTS: Draw the rock
                // Caution: Don't include spriteBatch.Begin or spriteBatch.End here
                //------------------------------------------------------------------

                spriteBatch.Draw(sprite, drawRectangle, Color.White);
            }
        }
« Last Edit: March 11, 2015, 01:42:54 pm by JDFan »

DaOld Man

  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5158
  • Last login:May 24, 2025, 09:57:44 pm
  • Wheres my coffee?
    • Skenny's Outpost
Re: Beginning game programming course
« Reply #279 on: March 11, 2015, 01:44:58 pm »
Struggling this week! The stuff learnt in the course (ifs etc) is no problems but passing/using the spriteBatch to Rock.Draw I've not a clue! Is it something made more obvious by owning the book?

I have found using the forum on the coursea site very useful.
Just search for the problem you are having and you will probably get several answers, most are right but some don't work.
Looks like JDFan answered your question while I was typing!