Forums

Sega Master System / Mark III / Game Gear
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats - Credits
Music - Videos - Development - Hacks - Translations - Homebrew

View topic - Oranges

Reply to topic Goto page 1, 2  Next
Author Message
  • Joined: 06 Sep 2015
  • Posts: 263
  • Location: United States
Reply with quote
Oranges
Post Posted: Thu Jun 22, 2017 6:18 pm
OK, so I found another project I had began work on. I changed the stuff from lemons to oranges. I am going to attempt to port my Oranges game from the Game Boy to the Game Gear as well. You can read all about the Game Boy game on its webpage here. I would hope that the color the Game Gear can do would enhance the game significantly. But all I have so far is a lonely screenshot. I forgot how to do music.
  View user's profile Send private message Visit poster's website
  • Joined: 06 Sep 2015
  • Posts: 263
  • Location: United States
Reply with quote
Post Posted: Thu Jun 22, 2017 9:35 pm
I discovered again how to do music. I put in some music for the title screen. I arranged it myself. What do you think?
oranges20170622v4.zip (3.74 KB)
Oranges 6/22/2017 version 4

  View user's profile Send private message Visit poster's website
  • Joined: 25 Dec 2005
  • Posts: 607
  • Location: São Paulo - Brazil
Reply with quote
Post Posted: Fri Jun 23, 2017 2:37 am
I liked it.
  View user's profile Send private message
  • Joined: 06 Sep 2015
  • Posts: 263
  • Location: United States
Reply with quote
Post Posted: Fri Jun 23, 2017 4:53 pm
Thanks.
I was reading on how to use the Start button on the Game Gear. I made it so it starts the game with it, but pausing it using the start button won't work. It only pauses the game if I keep holding the Start button. And if I let go of it, it starts up again. So I guess you won't be able to pause this version.
  View user's profile Send private message Visit poster's website
  • Joined: 06 Sep 2015
  • Posts: 263
  • Location: United States
Reply with quote
Post Posted: Fri Jun 23, 2017 6:32 pm
THERE. I finally was able to get it the way I want where start pauses the game as well as starts it. I don't know why it had to take hours, though. It seemed like such a simple idea.
  View user's profile Send private message Visit poster's website
  • Joined: 06 Sep 2015
  • Posts: 263
  • Location: United States
Reply with quote
Post Posted: Fri Jun 23, 2017 9:38 pm
Which title screen do you like better? The one in post #1, or this new one I made?
  View user's profile Send private message Visit poster's website
  • Joined: 01 Feb 2014
  • Posts: 849
Reply with quote
Post Posted: Sat Jun 24, 2017 6:36 am
The first one.
  View user's profile Send private message
  • Joined: 06 Sep 2015
  • Posts: 263
  • Location: United States
Reply with quote
Post Posted: Sat Jun 24, 2017 1:22 pm
I put the first title screen back in. I also began work on the ingame. I got the Orange-o-matic screen in. Bob can move around. I was wondering though if there's an easy way to flip the sprite or would I have to create new sprites for facing left?
  View user's profile Send private message Visit poster's website
  • Joined: 01 Feb 2014
  • Posts: 849
Reply with quote
Post Posted: Sat Jun 24, 2017 1:26 pm
Gamegearguy wrote
I was wondering though if there's an easy way to flip the sprite or would I have to create new sprites for facing left?

You have to create new sprites for facing left. The SMS can flip background tiles, but not sprites.
  View user's profile Send private message
  • Joined: 06 Sep 2015
  • Posts: 263
  • Location: United States
Reply with quote
Post Posted: Sat Jun 24, 2017 1:59 pm
This is a Game Gear game. Is it the same?
  View user's profile Send private message Visit poster's website
  • Joined: 01 Feb 2014
  • Posts: 849
Reply with quote
Post Posted: Sat Jun 24, 2017 2:50 pm
Gamegearguy wrote
This is a Game Gear game. Is it the same?

Yes.
  View user's profile Send private message
  • Joined: 06 Sep 2015
  • Posts: 263
  • Location: United States
Reply with quote
Post Posted: Sat Jun 24, 2017 3:37 pm
OK, I made some left facing sprites of Bob and put them in the game. When I play the game on a real Game Gear, though, the white and light gray seem to blur, so I'll change it. I don't know why that would happen though. But I don't know what color to change it to. Dark gray, perhaps?
  View user's profile Send private message Visit poster's website
  • Joined: 22 Mar 2015
  • Posts: 228
Reply with quote
Post Posted: Sat Jun 24, 2017 3:39 pm
I've just played and is really fun!!, are you going to make a SMS version?
  View user's profile Send private message
  • Joined: 06 Sep 2015
  • Posts: 263
  • Location: United States
Reply with quote
Post Posted: Sat Jun 24, 2017 4:37 pm
I don't have an Everdrive for the SMS, I used to but I broke it somehow. So for now, it'll be just for the Game Gear. I spent the last half-hour trying various color schemes and stumbled upon something: The Game Gear does not like it when you use black. That's why it kept on blurring: The black horizontal line edges. So I colored them. I made them all really colorful and as a result, there is far less blurriness on the Game Gear screen. I wonder why.
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14690
  • Location: London
Reply with quote
Post Posted: Sat Jun 24, 2017 6:11 pm
The LCD is slow to change between extremes like black and white. This results in trails when things move around, but if you remove the contrast it may make it harder to see things.
  View user's profile Send private message Visit poster's website
  • Joined: 06 Sep 2015
  • Posts: 263
  • Location: United States
Reply with quote
Post Posted: Sat Jun 24, 2017 10:20 pm
The score is now working after many attempts to get the colors right. It took about 90 minutes to do. I had to rearrange the colors using GIMP (if only they could have made the program more user-friendly...) So here is what I have so far. The score increases when you go right. This is just to test the score to see if I did it correctly. I guess I'll make this version goal-less and the point being to see how high a score you can get. 9999 is the highest possible score, seeing as how I have 4 digits in. Now I have a problem, how can I get 5 different sprites that look exactly the same in the game (the oranges?) There should be some shortcuts since they look the same, but I'm not quite sure what they are. The oranges' y positions are fixed, only the x positions change, they go from right to left. I've attached what I have so far.

oranges20170624v5romonly.zip (4.61 KB)
The current build

  View user's profile Send private message Visit poster's website
  • Joined: 06 Sep 2015
  • Posts: 263
  • Location: United States
Reply with quote
Post Posted: Sun Jun 25, 2017 7:23 pm
Changed the colors around on the background. It now looks like this:

I also fixed a bug involving moving a pixel when the game just gets unpaused. I need help on the oranges, though. There's 5 of them. Since they're all going to be the same shape and color, would that make it easier somehow, or do I need to do codes for all five of them? I figure it would be like Sonic and the rings somehow. But how?
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14690
  • Location: London
Reply with quote
Post Posted: Sun Jun 25, 2017 7:28 pm
It's difficult to understand your question, because how have you got this far without reusing tiles? Or is it about writing code which operates on each orange in turn? How did you do it for the GB version?

I'd use WLA DX structs to define the memory for each object (presumably there's an X and Y, maybe some state and speed, etc) and then use the index registers to point to each one to pass into an update function.
  View user's profile Send private message Visit poster's website
  • Joined: 06 Sep 2015
  • Posts: 263
  • Location: United States
Reply with quote
Post Posted: Sun Jun 25, 2017 9:04 pm
Here's the Game Boy code I used to make the oranges:

   set_sprite_data(8, 8, orange);
   set_sprite_tile(2, 8);
   set_sprite_tile(3, 8);   
     set_sprite_tile(4, 8);   
     set_sprite_tile(5, 8);   
     set_sprite_tile(6, 8);      

The first line calls where the data for the shape and colors of the orange is and the next lines tell the program to use sprites 2-6 as the oranges. (In case you're wondering, sprites 0 and 1 are Bob and sprite 7 is the powerup.)
I guess what I'm after is this:

.equ bobvp $c008           
.equ bobhp $c090         
.equ bobcc $c091           

This is the code for the Bob sprite. How far up along can the vp part be? Right now I have it ending at $c018

.equ endspr $c018          ; first unused sprite.

I haven't done a Game Gear game yet that uses more than a couple sprites. The oranges will be at fixed y positions, only the oranges' x positions will change (decrease).
  View user's profile Send private message Visit poster's website
  • Joined: 06 Sep 2015
  • Posts: 263
  • Location: United States
Reply with quote
Post Posted: Sun Jun 25, 2017 11:00 pm
And now there are oranges.
But how to make them random?
On the Game Boy, there's this register that increases like over 1,000 times a second or so. I used it for the basis of the randomness in the Game Boy version of Oranges. It is called ptr_div_reg. I am wondering if the Game Gear has something similar. If not, I'm unsure on how to make the oranges random.
  View user's profile Send private message Visit poster's website
  • Joined: 22 Mar 2015
  • Posts: 228
Reply with quote
Post Posted: Sun Jun 25, 2017 11:38 pm
I would like to help with one suggestion Do you think the final build is going to look like the GB version but colored? but please keep the current title screen It just looks pretty good.
  View user's profile Send private message
  • Joined: 06 Sep 2015
  • Posts: 263
  • Location: United States
Reply with quote
Post Posted: Mon Jun 26, 2017 12:50 pm
Yes, I'm going to keep the title screen as is.
  View user's profile Send private message Visit poster's website
  • Joined: 06 Sep 2015
  • Posts: 263
  • Location: United States
Reply with quote
Post Posted: Wed Jun 28, 2017 6:05 pm
So I have read this page:
http://www.smspower.org/Development/RandomNumberGenerator
And I have a few questions.
#1 - What is the value range of an "8-bit number"?
#2 - Can I make the number be a random number between, say, 1-4? That would be good enough for my game.
#3 - How well does this work? What I mean is, how does it work, would it be ideal for a number between 1-4? How many times per second would the number change? I've never played Phantasy Star, so why would it need a random number generator?
#4 - Does this work in Game Gear?
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14690
  • Location: London
Reply with quote
Post Posted: Wed Jun 28, 2017 7:32 pm
1. 0 to 255. It's hard to see how you can program and not know this!
2. Yes, you can mask or modulo it.
3. It's OK, random enough. As many numbers per second as you like. Phantasy Star uses it to randomise the battles.
4. Yes.
  View user's profile Send private message Visit poster's website
  • Joined: 06 Sep 2015
  • Posts: 263
  • Location: United States
Reply with quote
Post Posted: Wed Jun 28, 2017 9:51 pm
I see, 8-bits means it's using 8 digits for its binary number. So how would I mask this 8 bit returned number and make it a 2-bit number?
  View user's profile Send private message Visit poster's website
  • Joined: 01 Feb 2014
  • Posts: 849
Reply with quote
Post Posted: Thu Jun 29, 2017 7:24 am
Gamegearguy wrote
I see, 8-bits means it's using 8 digits for its binary number. So how would I mask this 8 bit returned number and make it a 2-bit number?

Same method as the last time you asked the question (in this thread):

and %00000011
  View user's profile Send private message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14690
  • Location: London
Reply with quote
Post Posted: Thu Jun 29, 2017 11:06 am
Heh, well remembered :)
  View user's profile Send private message Visit poster's website
  • Joined: 06 Sep 2015
  • Posts: 263
  • Location: United States
Reply with quote
Post Posted: Fri Jun 30, 2017 12:34 pm
I seem to be having trouble with collision detection. When I check for it in the code, it automatically goes back to the title screen, regardless of whether it has actually touched a sprite or not. What is going on here? I've attached the code here. (the collision code is lines 412-4.
orangescode20170630.zip (6.38 KB)
Oranges .asm file.

  View user's profile Send private message Visit poster's website
  • Joined: 01 Feb 2014
  • Posts: 849
Reply with quote
Post Posted: Sun Jul 02, 2017 8:12 am
Gamegearguy wrote
I seem to be having trouble with collision detection. When I check for it in the code, it automatically goes back to the title screen, regardless of whether it has actually touched a sprite or not. What is going on here?

This line:
jp nz,prepti        ; yes - go back to beginning.

makes your game jump back to the label marking the initialization of the title screen (prepti).

Check if any of your sprites overlap. That could also be the sprites the player character consists of. The status flag doesn't know about the objects in the game. It just checks if any two sprites overlap.

I suggest not using the status bit for collision detection at all and better set up a proper hit detection routine.
  View user's profile Send private message
  • Joined: 06 Sep 2015
  • Posts: 263
  • Location: United States
Reply with quote
Post Posted: Sun Jul 02, 2017 7:42 pm
None of the sprites overlap.
Wouldn't this be the simplest, best way to have collision detection since it doesn't matter which of the oranges Bob hits?
  View user's profile Send private message Visit poster's website
  • Joined: 01 Feb 2014
  • Posts: 849
Reply with quote
Post Posted: Mon Jul 03, 2017 8:58 am
Gamegearguy wrote
None of the sprites overlap.
Wouldn't this be the simplest, best way to have collision detection since it doesn't matter which of the oranges Bob hits?

If bit 5 is set in the status flag, it means that at least two of your sprites overlap. There's no two ways about it. You just have to find out which ones. This could very well be two oranges and it could also happen outside the visual screen area. Note that even transparent pixels of sprites can overlap, even if it doesn't look like it.

The status bit is literally the worst way to check for collions.

May I suggest that you leave hang-on's old Racer code behind and rewrite your game from scratch? You will get a much better game out of it and learn something fun (z80 assembly language).
  View user's profile Send private message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14690
  • Location: London
Reply with quote
Post Posted: Mon Jul 03, 2017 11:21 am
I think the sprite colison bit does ignore transparent pixels. It's just super restrictive to require all sprite overlaps to mean a single thing...
  View user's profile Send private message Visit poster's website
  • Joined: 01 Feb 2014
  • Posts: 849
Reply with quote
Post Posted: Mon Jul 03, 2017 11:54 am
You're right. I mixed it up with status bit 6 (sprite overflow) which works regardless of transparency.
  View user's profile Send private message
  • Joined: 04 Jul 2010
  • Posts: 539
  • Location: Angers, France
Reply with quote
Post Posted: Mon Jul 03, 2017 12:20 pm
Maxim wrote
I think the sprite colison bit does ignore transparent pixels.


Exactly.
I'm using this method in Cimmerian. Works perfectly.
  View user's profile Send private message
  • Joined: 06 Sep 2015
  • Posts: 263
  • Location: United States
Reply with quote
Post Posted: Sat Aug 19, 2017 4:36 am
I came back to working on this again. I didn't find out what the problem was, so I had to work my way around it. I think I finally got it to a playable state. Barely a game right now. Not a very hard game, so I'll keep working on this.
oranges20170818.zip (15.01 KB)
August 18, 2017 build of Oranges

  View user's profile Send private message Visit poster's website
  • Joined: 01 Feb 2014
  • Posts: 849
Reply with quote
Post Posted: Sun Aug 20, 2017 7:57 am
Gamegearguy wrote
I didn't find out what the problem was, so I had to work my way around it.

Your sprite table is a mess (see attached picture). It's obvious that you're doing something very wrong there, so that's the place where I would start debugging. Seriously, what are you doing?

My guess is that you're displaying the player sprites several times on top of each other which consequently leads to the collision bit being set.

  View user's profile Send private message
  • Joined: 06 Sep 2015
  • Posts: 263
  • Location: United States
Reply with quote
Post Posted: Sun Aug 20, 2017 11:19 am
I tried various things, but nothing I did didn't give me a whole bunch of heads in the sprite debugger window.
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14690
  • Location: London
Reply with quote
Post Posted: Sun Aug 20, 2017 11:19 am
Kagesan wrote
Seriously, what are you doing?

It's a recurring theme, unfortunately.
  View user's profile Send private message Visit poster's website
  • Joined: 06 Sep 2015
  • Posts: 263
  • Location: United States
Reply with quote
Post Posted: Sun Aug 20, 2017 11:57 am
I'll stop making Game Gear games if you want me to.
  View user's profile Send private message Visit poster's website
  • Joined: 09 Dec 2013
  • Posts: 228
  • Location: detroit
Reply with quote
Post Posted: Sun Aug 20, 2017 12:43 pm
Gamegearguy, IMO don't let some random person on the internet ruin your fun because they are having a bad day, its not worth it.

best regards,
- dink
  View user's profile Send private message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14690
  • Location: London
Reply with quote
Post Posted: Sun Aug 20, 2017 8:09 pm
The random tinkering can eventually produce things but I feel sorry for you not spending a bit more time to understand so you can make more progress, it seems really inefficient to me. Maybe it works for you but be aware that it can frustrate the attempts of others to help. It's a bit "old shoe or glass bottle" sometimes.
  View user's profile Send private message Visit poster's website
  • Joined: 06 Sep 2015
  • Posts: 263
  • Location: United States
Reply with quote
Post Posted: Mon Sep 18, 2017 11:07 am
I finally got the status 5 bit thing working! It took a whole bunch of time to figure out how to fix what was wrong, but I eventually did. I got rid of the excess weird sprites. One remains though, it's a vertical green line. I don't know why it's in the sprite data. But it works okay and it doesn't show up on screen and doesn't mess up the status, so it will remain there. So anyway, now I can continue working on this.
oranges20170918.zip (13.62 KB)
Oranges: September 18, 2017

  View user's profile Send private message Visit poster's website
  • Joined: 01 Feb 2014
  • Posts: 849
Reply with quote
Post Posted: Mon Sep 18, 2017 4:38 pm
Nice. Not much of a challenge, though.
  View user's profile Send private message
  • Joined: 06 Sep 2015
  • Posts: 263
  • Location: United States
Reply with quote
Post Posted: Mon Sep 18, 2017 5:22 pm
I'm not finished with it yet. I am going to add power-ups.
  View user's profile Send private message Visit poster's website
  • Joined: 06 Sep 2015
  • Posts: 263
  • Location: United States
Reply with quote
Post Posted: Mon Sep 18, 2017 11:47 pm
As it turns out, I can't use that collision code since I want it to ignore the collisions between the power-up and oranges. The first power-up is a bottle of syrup which will slow the oranges down if you get it.
  View user's profile Send private message Visit poster's website
  • Joined: 06 Sep 2015
  • Posts: 263
  • Location: United States
Reply with quote
Post Posted: Sun Oct 29, 2017 8:23 pm
I've been working on this for a little bit. I added a fork which will enable you to eat the oranges. Bob's shirt will change to blue then to orange to let you know the power up is about to wear off, and then green when it's normal.
oranges20171029.zip (15.6 KB)
Oranges: October 29, 2017

  View user's profile Send private message Visit poster's website
  • Joined: 28 Jan 2017
  • Posts: 548
  • Location: Málaga, Spain
Reply with quote
Post Posted: Sun Oct 29, 2017 9:17 pm
Some insight (from my own point of view)

Its a very simple idea. But It could turn into a way more interesting one with stages, and different objects with different patterns by stage.

The music. Maybe i could help here if you want. I am getting fun composing music.

It seems you are using wladx. Its ok and Will let you to have a deeper knowledge about sms hardware, but i think with c your idea could get deeper in an easier and faster way.

I dont see any problem with software collisions checking. There are not many objects at once.

Check the sprites. Some Sprite does not have the hair (up? Down?)

Regards and good work with the game
  View user's profile Send private message
  • Joined: 06 Sep 2015
  • Posts: 263
  • Location: United States
Reply with quote
Post Posted: Sun Oct 29, 2017 9:44 pm
Thanks for the input. I am going to add some more stuff still to the game. For instance, one of the things I'm planning to do is have the oranges' speed increase after 100 points. And I am going to add a couple more power ups. And a game over screen. For the music I need to have a PSG file if you'd like to help with that. I didn't know I could use C, which would make development way quicker. But I have no idea how to set it up. Would I still need ConText?
  View user's profile Send private message Visit poster's website
  • Joined: 28 Jan 2017
  • Posts: 548
  • Location: Málaga, Spain
Reply with quote
Post Posted: Mon Oct 30, 2017 6:17 am
Sdcc , smsdevkit , psglib should do the work.

I began 9 months ago with some homebrew src from this site and the curve is smooth (mainly thanks to sverx, AA and others)

... Could you tell me What Sort of music are you thinking for your Game? (I was thinking a Bubble bobble / casual like music for the ingame)

Regards
  View user's profile Send private message
  • Joined: 06 Sep 2015
  • Posts: 263
  • Location: United States
Reply with quote
Post Posted: Mon Oct 30, 2017 7:23 pm
I was thinking mysterious music, sort of like what I have in there now.
  View user's profile Send private message Visit poster's website
Reply to topic Goto page 1, 2  Next



Back to the top of this page

Back to SMS Power!