ipod touch for ds

Show us what you're making.

ipod touch for ds

Postby chasegoree » May 15th, 2011, 2:40 am

An iPod touch for ds currently with 2 apps!!!
Stylish sprint:You play a stick figure that has to run to the finish=8 levils
Gun app:You shoot animated guns with your ds, currently has mini gun, pistol, and shotgun.
If you have any suggestions post them below!!!!!!!!!!! :shock:
Attachments
ipodsample.bmp
the ipod
ipodsample.bmp (288.05 KiB) Viewed 2832 times
ipod touch for ds.nds
the game
(19.19 MiB) Downloaded 123 times
Rockleeace is moi. Moi is n00b programmer. I like saying moi.
┏━━━┓
┃┏━━┛
┃┗━━┳━━┳┳━━┓
┃┏━━┫┏┓┣┫┏━┛
┃┗━━┫┗┛┃┃┗━┓
┗━━━┫┏━┻┻━━┛

Working on these titles
Gun Game viewtopic.php?f=13&t=2053
Teen Titans Beast Boys Adventure viewtopic.php?f=13&t=2105
Kingdom hearts pro skater viewtopic.php?f=8&t=2124
The Undead 4-Nazi Zombies viewtopic.php?f=13&t=2866
chasegoree
 
Posts: 240
Joined: March 5th, 2011, 10:05 pm

Re: ipod touch for ds

Postby YoshiInAVoid » May 15th, 2011, 10:14 am

So it's just minigames you have previously made, and you have put them into an buggy iphone menu system?
YoshiInAVoid
 
Posts: 1960
Joined: December 30th, 2010, 11:53 am
Location: England

Re: ipod touch for ds

Postby DawnKeybles » May 15th, 2011, 10:51 am

lol good gravity for the stickman!

and the collision detection is amazing! how did u make him go through the block?
Stick.png
Stick.png (4.45 KiB) Viewed 2822 times
haha prank name

Donkey balls

I misspeltmy username, it should be Don Keeballs as it's easyer to understand but oh well.
DawnKeybles
 
Posts: 25
Joined: May 12th, 2011, 7:10 pm

Re: ipod touch for ds

Postby chasegoree » May 15th, 2011, 6:04 pm

DawnKeybles wrote:lol good gravity for the stickman!

and the collision detection is amazing! how did u make him go through the block?

its a bug that i tried to fix, if i fix it it messes up gravity and the stickman walks in the air
Attachments
ipodscreenshot.bmp
ipodscreenshot.bmp (288.05 KiB) Viewed 2814 times
Rockleeace is moi. Moi is n00b programmer. I like saying moi.
┏━━━┓
┃┏━━┛
┃┗━━┳━━┳┳━━┓
┃┏━━┫┏┓┣┫┏━┛
┃┗━━┫┗┛┃┃┗━┓
┗━━━┫┏━┻┻━━┛

Working on these titles
Gun Game viewtopic.php?f=13&t=2053
Teen Titans Beast Boys Adventure viewtopic.php?f=13&t=2105
Kingdom hearts pro skater viewtopic.php?f=8&t=2124
The Undead 4-Nazi Zombies viewtopic.php?f=13&t=2866
chasegoree
 
Posts: 240
Joined: March 5th, 2011, 10:05 pm

Re: ipod touch for ds

Postby YoshiInAVoid » May 15th, 2011, 6:15 pm

How could it mess up the gravity any more? Use velocity or else it's not even gravity!
YoshiInAVoid
 
Posts: 1960
Joined: December 30th, 2010, 11:53 am
Location: England

Re: ipod touch for ds

Postby chasegoree » May 15th, 2011, 10:45 pm

yoshi123 wrote:How could it mess up the gravity any more? Use velocity or else it's not even gravity!

i made it so if you touch the blocks youd go up to the top of it but using that it made it so if you walked off the block you wouldnt fall so ya
Rockleeace is moi. Moi is n00b programmer. I like saying moi.
┏━━━┓
┃┏━━┛
┃┗━━┳━━┳┳━━┓
┃┏━━┫┏┓┣┫┏━┛
┃┗━━┫┗┛┃┃┗━┓
┗━━━┫┏━┻┻━━┛

Working on these titles
Gun Game viewtopic.php?f=13&t=2053
Teen Titans Beast Boys Adventure viewtopic.php?f=13&t=2105
Kingdom hearts pro skater viewtopic.php?f=8&t=2124
The Undead 4-Nazi Zombies viewtopic.php?f=13&t=2866
chasegoree
 
Posts: 240
Joined: March 5th, 2011, 10:05 pm

Re: ipod touch for ds

Postby YoshiInAVoid » May 16th, 2011, 6:59 am

Thiers no need for that! Just make it so he can't walk through the block in the first place.
YoshiInAVoid
 
Posts: 1960
Joined: December 30th, 2010, 11:53 am
Location: England

Re: ipod touch for ds

Postby Bobbyloujo » May 16th, 2011, 9:01 pm

Perhaps instead of criticizing him you could teach him how to do it.
Seriously never posting again, lawlz.
jk
Bobbyloujo
 
Posts: 1295
Joined: December 30th, 2010, 8:40 pm
Location: Uh-merica

Re: ipod touch for ds

Postby YoshiInAVoid » May 16th, 2011, 9:06 pm

Gravity theoromy:

Declare Y
Same for VY

VY+Gravity; (something like 1)
Y=Y+VY;

For birshifts just set the Y to Y>>8 and gravity to 128 or soemhting
YoshiInAVoid
 
Posts: 1960
Joined: December 30th, 2010, 11:53 am
Location: England

Re: ipod touch for ds

Postby cilein » May 17th, 2011, 12:21 am

Doesn't explain much Yoshi, you know it but you need to elaborate/explain a little more for that to be of use.

He made a good start to gravity correction, but ideally gravity itself has acceleration, where you fall faster the longer you are falling. Smooth acceleration that isn't too fast can be achieved with bitshifts, by allowing movement in partial pixels. For correction methods where you 'overstep' the distance and end up in a solid area, its better to program the method to check whether you will end up in a solid or not, and if so, move less so you dont, rather than fix it after it happens, as players will notice this.
cilein
 
Posts: 302
Joined: December 31st, 2010, 12:10 am
Location: EU

Re: ipod touch for ds

Postby Nobody » May 17th, 2011, 1:20 am

People always include gravity in their games, but i have had people throw a few of those bitshift things in my face a few time on the forum, and i'm still slightly confused by it. Could someone actually post one using gravity and give a more elaborate explanation? That would help me make a good platformer.
Feel free to ask me for help. I'm on the forum a lot.

Recent Projects:
Crafters DS (Minecraft 2D Clone!) viewtopic.php?f=13&t=3082 (latest project!)
The Living Dead - viewtopic.php?f=13&t=1582
Mario Craft - viewtopic.php?f=8&t=1736 (Most Popular!)
Spawn Zombies - viewtopic.php?f=13&t=3444 (Newest)
User avatar
Nobody
 
Posts: 1942
Joined: February 14th, 2011, 12:08 am
Location: United States of America

Re: ipod touch for ds

Postby YoshiInAVoid » May 17th, 2011, 7:22 am

Bitshifts are a way of doing decimals, but not quite. Let me explain:

From decimals when you are adding something, it will move it between say 1 and 2, so adding .5 would make it 1.5.

Now the DS isn't quite very good at that, so it needs to add a whole number, but 1 is too much.

This is where the bitshifts come in, if we times 1 number by 2 we will get 2, and then we can add 1 (0.5 * 2) to that, then if we divide it by 2 again when we are actually using it, it will go to 1.5, same as if we where just using decimals like above.

But, you can't have a sprite at 1.5 pixels! So it will just jump him to 1, until the whole of the varaible reaches 2, but that means that this will take 2 times as long, which is what we wanted if we where using decimals.

Lets declare a variable, how about X?
int X = 10*2;

Then we set X +1
X = X+1;

Now jump to what X should really be:
Set Sprite X;X/2

This example is the same as saying:

Lets declare a variable, how about X?
int X = 10;

Then we set X +1
X = X+0.5;

Now jump to what X should really be:
Set Sprite X;X

As long as if you Xmsed it be 2, and you divide it by 2 to find what it really should be, it will work fine!

But... That's not quite bitshifts, that's just timesing and divideing. Bitshifts it essentially the same thing, but it is writen differently, the above example still works, but this is how it should be done:

Lets declare a variable, how about X? The << means make it bigger
int X = 10<<1;

Then we set X +1
X = X+1;

Now jump to what X should really be: >> means make smaller
Set Sprite X;X>>1

when using bitshifts, to times by 2 I have used one, to times by 4 I would use 2, for 3 it would be 8, 4 = 16 5 = 32, 6 = 64, 7 = 128, 8 = 256!

So if we used <<8, it would mean that to add one normal pixel we would use:
X+256;

So to move at .5 per frame it would be:
X+128



I hope this is clear and makes up for my poor explanation of gravity.
YoshiInAVoid
 
Posts: 1960
Joined: December 30th, 2010, 11:53 am
Location: England

Re: ipod touch for ds

Postby Nobody » May 17th, 2011, 9:33 pm

It makes a little more since now, but i'm still shortly lost. The above sorta makes since, and it might make more since if i finish off a bit more math in school and spent a little more time paying attention in your explanation, but i get the gist of what your talking about. Now, my question is, how do you know how to adapt this in certain ways to make your characters accelerate? The whole X<<2 makes some since, it's multiplying. But in detail i have no clue what it's actually doing, i just know it makes the number bigger somehow. Specifically, how is the number being increased and maybe i could understand how acceleration is done? That is the thing i could never get to rap around my head. Surely if i could understand this i could use acceleration in my games.
Feel free to ask me for help. I'm on the forum a lot.

Recent Projects:
Crafters DS (Minecraft 2D Clone!) viewtopic.php?f=13&t=3082 (latest project!)
The Living Dead - viewtopic.php?f=13&t=1582
Mario Craft - viewtopic.php?f=8&t=1736 (Most Popular!)
Spawn Zombies - viewtopic.php?f=13&t=3444 (Newest)
User avatar
Nobody
 
Posts: 1942
Joined: February 14th, 2011, 12:08 am
Location: United States of America

Re: ipod touch for ds

Postby YoshiInAVoid » May 18th, 2011, 4:47 pm

Accelleration is simple. First off we need to talk about it in a larger scale so as to be simpler, then we will add in the bitshifts to use it in a real situation.

int X, XV;
XV+Pad.Held.Right&&XV<5;
X+=XV;

This is the simple and basic code. The top speed being 5 and the speed it accelerates at being the defult 1. Thier is no code that will de accelerate after letting go, just simple acceleration when you hold right.

Now lets brake it down alot so as it's easy to come to terms with.

int X = 0;
int XV = 0;
if (Pad.Held.Right) {
if (XV < 5) {
XV = XV+1;
}
}
X = X+XV;

There we go, thats very simple, but took a fricking year to type out! As aposed to the 3 line alternative.

So anyway, whats happening is that when you hold right, and XV is not at the max speed, then we can increse XV. Then we move the players X forward depending on the value of XV. So as XV starts off as 0 we will be adding 0 to X, then if you tap the button for a frame it will turn XV to 1 so the player will move at 1 pixel per frame, then hold it down for a frame more and it will move at 2 pixels per frame, and so on until it reaches 5 where no matter whether your holding right or not it will still go at 5 per frame and no faster.

Simplez no?

So now we test! It turns out 5 pixels per frame is waaaayyyyyyyy too fast! How about 2? Then we test, it only takes 2 frames to move XV from 0 to 1, and then to 2 which is hardly noticeable at all, you may as well not use acceleration and make it go straight from 0 to 2.

So what do we do??? BITSHIFTS ARE THE ANSWER TO ALL YOUR PROBLEMS AND MORE!

So, to keep this extra extra simple, we will only <<1 which is the same as timesing by 2, then that means that we can move out player half a pixel a frame, so it goes through 0, to 0.5, to 1, to 1.5, to 2. Twice as many frames, meaning it will take twice as long, and twice as smooth.

So here is that example again:

int X = 0<<1; //The <<1 means multiply by 2
int XV = 0;
if (Pad.Held.Right) {
if (XV < 4) { //4 Is 2<<1 or 2*2 or two multiplyed by two, take your pick!
XV = XV+1;
}
}
X = X+XV;
Preffered method of moving graphic to X position(X>>1);

There we go. What happens do you ask? Well when we hold right, ensted of 2 being the limit, we increse it to 4, this means it will take twice as long to get to the max speed, but also it will move twice as fast wehn it reaches that, so... Then at the end, we move the graphic or sprite to the value of X divided by two, this means that it does not infact go twice as fast, but it will takes twice as long to get to the max speed.

So lets wither that down to the simple code that takes not nearly enough space but does the same thing, (optional):

int X, XV;
XV+Pad.Held.Right&&XV<4;
X+=XV;

Then just remember that when you use PA_SetSpriteX or whatever DSGM does, make the X paramter X>>1
YoshiInAVoid
 
Posts: 1960
Joined: December 30th, 2010, 11:53 am
Location: England

Re: ipod touch for ds

Postby Foxi4 » May 18th, 2011, 6:06 pm

"The Black Paradise" just happens to be a game about a "Black Stickman".

I'm glad to see a racially-correct game.
Current Projects:

FalloutDS: Postponed until proper libraries are created, 10%
Foxi_Lib: A completely revised version of NitroSprites[FINAL], NitroBackgrounds and NitroText[FINAL], 40%
Foxi4
 
Posts: 1114
Joined: December 31st, 2010, 3:25 am

Re: ipod touch for ds

Postby Nobody » May 19th, 2011, 1:29 am

Thanks yoshi, with some more reviewing, i could get somewhere with this :)
Feel free to ask me for help. I'm on the forum a lot.

Recent Projects:
Crafters DS (Minecraft 2D Clone!) viewtopic.php?f=13&t=3082 (latest project!)
The Living Dead - viewtopic.php?f=13&t=1582
Mario Craft - viewtopic.php?f=8&t=1736 (Most Popular!)
Spawn Zombies - viewtopic.php?f=13&t=3444 (Newest)
User avatar
Nobody
 
Posts: 1942
Joined: February 14th, 2011, 12:08 am
Location: United States of America

Re: ipod touch for ds

Postby YoshiInAVoid » May 19th, 2011, 4:25 pm

I'll make an example for you.

EDIT: Damn I forgot this is a DSGM forum and not just regular coding forum, sorry I don't do DSGM4 anymore, yet alone 5, but if you put it into a script it should work!
YoshiInAVoid
 
Posts: 1960
Joined: December 30th, 2010, 11:53 am
Location: England

Re: ipod touch for ds

Postby Nobody » May 19th, 2011, 9:50 pm

It's okay, i've think i have a few examples of bitshift from the forum. The explanation helped though
Feel free to ask me for help. I'm on the forum a lot.

Recent Projects:
Crafters DS (Minecraft 2D Clone!) viewtopic.php?f=13&t=3082 (latest project!)
The Living Dead - viewtopic.php?f=13&t=1582
Mario Craft - viewtopic.php?f=8&t=1736 (Most Popular!)
Spawn Zombies - viewtopic.php?f=13&t=3444 (Newest)
User avatar
Nobody
 
Posts: 1942
Joined: February 14th, 2011, 12:08 am
Location: United States of America

Re: ipod touch for ds

Postby YoshiInAVoid » June 2nd, 2011, 4:32 pm

Ok, so makshun was having problems with bitshifts as well so he sent me a PM. I was going to reply, and then I thought, that I may as well make it public so as others can have the help as well.

Ok. Look at this code below.

Declare X Starting at 0
Set X + 1
If X == 2
PA_OutputSimpleText("%d", X);
End If

If X starts at 0, and goes up by 1 every frame, it will take 2 frames to get X to 2, and then have the value of X appear.

Now look at this code:

Code: Select all
Declare X Starting at 0
Set X + 1
If X == 4
PA_OutputSimpleText("%d", X);
End If


This means it will take 4 frames to get the text to appear, but that is wrong because we want it to say 2 after 4 frames, but it will say 4.

So what we would do is this:

Code: Select all
Declare X Starting at 0
Set X + 1
If X == 4
PA_OutputSimpleText("%d", X/2);
End If


This means that we will divide X by 2, so if X is 4, it will say 2! Which is great because that's what we want!

Now that code does work, but in bitshifts divide by 2 is >>1, here is a quick chart:

Divide by 2 = >>1
Divide by 4 = >>2
Divide by 8 = >>3
Divide by 16 = >>4
Divide by 32 = >>5
Divide by 64 = >>6

And so on...

That is bitshifts in really simple terms. Now view my other 2 explanations above and hopefully you will understand it better now.
YoshiInAVoid
 
Posts: 1960
Joined: December 30th, 2010, 11:53 am
Location: England

Re: ipod touch for ds

Postby ZombieOfun » August 25th, 2011, 3:58 am

btw, my pm was ment for the gun app remake u have on the ipod ds
Im good at VFX! if you want me to advertise your homebrew game with a youtube video it would be good practice :)
ZombieOfun
 
Posts: 8
Joined: March 14th, 2011, 11:48 pm

Next

Return to Work In Progress

Who is online

Users browsing this forum: No registered users and 0 guests