Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Work in Progress / Fizz! - Easy 2D Physics

Author
Message
Chris K
21
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Lake Hylia
Posted: 23rd Mar 2005 17:00 Edited at: 19th Apr 2005 03:53
Fizz!
Super Easy 2D Physics with Newton

Fizz! is a set of very easy to use functions that allows you to have real world physics in your 2D games with Newton.

Screenshots





Videos
Explosion - 700kb
Grenade - 500kb
Catapult - 150kb
Mario - 450kb (mov)
Mario & Luigi - 350kb (mov)

Code



How to Install

Copy & Paste the code from above into DBPro
File -> Save Source As... -> Saved it in your project directory, named "Fizz.dba"
In your project click the "Files" tab (bottom right)
Click "Browse", double click "Fizz.dba"
File -> Save All
Your done installing!

How to Use

WHEN USING FIZZ! ALL LENGTHS AND POSITIONS ARE IN PIXELS

You need to call the command StartFizz() at the top of your program, then you need to call UpdateFizz() every loop.

If you want to create an invisible, static object (such as a wall) you use these commands:
MakeStaticBox( Width, Height, xPos, yPos, Angle )
MakeStaticOval( Width, Height, xPos, yPos, Angle )

If you want to create a moving object you need to use these commands:
MakeMovingBox( Width, Height, xPos, yPos, Angle, Mass, SpriteNumber, ImageNumber )
MakeMovingOval( Width, Height, xPos, yPos, Angle, Mass, SpriteNumber, ImageNumber )

The SpriteNumber is like an object number, it must be unique to that object.

The ImageNumber is the number of the image which the sprite will use (the picture of the object). This must be loaded beforehand with load image

To make an explosion use this function:
AddExplosion( xPos, yPos, Force )

The force should be somewhere around 1000.

To scroll the screen you need to adjust the variables Screen( 1 ) and Screen( 2 ). These are the x and y positions of the camera.

For example:



MouseScroll( Speed ) - Call this every loop to use the mouse to scroll the screen (like an RTS)

To make a controllable player use the following command:
MakePlayer( PlayerNumber, xDiameter, yDiameter, xPos, yPos, xOffset, yOffset, SpriteNumber )

The player is an oval. For best results make is a bit smaller than your player sprite so you get a bit of overlap.

To move the player you need to adjust the Players#( Number, x ) array.
Players#( Number, 1 ) is the x speed.
Players#( Number, 2 ) should be set to about 350 when you want to jump.
Players#( Number, 3 ) tells you whether you can jump. If it is 0 then it is OK to jump.
To set what image to use for the player set Players#( Number, 5 ). You can do this dynamically to animate the player.

To build your level very easily you need to use this command:
BuildWorld( "Filename" )

To add a joint to your level use this command
MakeJoint( xPos, yPos, ChildSprite, ParentSprite )

You need to make the object you want to be jointed beforehand, in it's starting position, then you need to use this command to 'pin' it in place. If the object is connected to nothing, use ParentNumber of 0, if you want to make a chain you can specify a parent object to connect to.

Chains of three can be erratic.

You can make a Fizz! World with this editor:


Get the media here (about 5 kb)

Mouse click - place block
Mouse wheel - rotate
Arrow keys - change dimensions
Shift - speed up resizing
Space - reset camera to 0,0
Control + z - undo
Control + s - Save

You just need to make it show your level (without any players, objects or enemies), and then you can cover over the walls etc. with blocks.

When you are done press control + s, put in a filename.

Then you just need to put the files that are made in your project folder and call BuildWorld() with the right filename.

Sample Programs

Here are some sample programs to test out Fizz!
You need to use the media attached to this post (9kb)

Press 1 - 6 to make objects.


Use the mouse to place objects:


Wheel - Rotate
Left Click - Place / Explode!
Right Click - Change Object
Arrows - Scroll

Player Control:


A, S, D - Player 1
J, K, L - Player 2
Enter - Make crates (be careful!)

Please note that the girder object sometimes has some problems, if you want to use long thin objects with Fizz! then make sure you place them carefully when setting up the level, otherwise Newton can get confused.

If the programs above look too complicated here is a much simpler one:



Updates coming...

- More shapes!

My Showcase - It's DBpro-tastic

Attachments

Login to view attachments
Kentaree
22
Years of Service
User Offline
Joined: 5th Oct 2002
Location: Clonmel, Ireland
Posted: 23rd Mar 2005 17:28
Oooh, looks very nice ChrisK, gonna try it out when I have the chance

(I love your graphical style too, always tells me who made it )

Desktop: AMD Athlon XP2800+,Radeon 9800 128MB, 1GB DDR RAM
Laptop: AMD Athlon 64M 3000+,Mobility Radeon 9700 128MB, 512MB DDR RAM
Chris K
21
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Lake Hylia
Posted: 23rd Mar 2005 17:45 Edited at: 23rd Mar 2005 18:42
Cheers.

I am in the process of making a 2D platformer and I thought I'd bundle up the functions I was using for my fellow 2D coders.

Woot!!!

We rule. 2D is the new black.

My Showcase - It's DBpro-tastic
Nack
21
Years of Service
User Offline
Joined: 29th Jul 2003
Location:
Posted: 23rd Mar 2005 21:11
This looks awesome!....makes me want to make a 2d platformer too....*must...resist....urge* lol


I have NOT abandon these ^......^_^V hehe
Chris K
21
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Lake Hylia
Posted: 24th Mar 2005 00:08
Updated!

I added the AddExplosion() function.
Here it is by itself:



It's super cool and, of course, super easy to use.
You just slap in coordinates and a force and it affects every object you've made. Great fun.

My Showcase - It's DBpro-tastic
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 24th Mar 2005 00:15
He saw beans lots of beans lots of beans lots of beans yeah...

Looking great, I never thought I'd see physics plugins for 2D games, makes you wonder what they could have done with the Worms series .


Van-B


It's c**p being the only coder in the village.
Chris K
21
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Lake Hylia
Posted: 24th Mar 2005 00:24
I know, it's sad that 2D has been left behind. Some games just call for it. If the big companies still made 2D games then I'm sure we'd have 2D shaders as well.

Thank god the indie scene hasn't forgotten it with awesome games like Alien Hominid and Gish.

My Showcase - It's DBpro-tastic
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 24th Mar 2005 00:27
There are actually a few companies converting their old classics, like Sensible Software is making Sensi Soccer for mobile phones which should be awesome, I loved sensi. Old 16-bit classics are better mobile gaming fodder, so there's life left in 2D yet.

Now if you could make a platform engine with physics for Omega Basic, then I imagine you'd be a lot of peoples best friend .


Van-B


It's c**p being the only coder in the village.
Chris K
21
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Lake Hylia
Posted: 24th Mar 2005 00:31
I have got my own physics engine, coded in DBPro which might convert, but it can only do squares at the moment.

This one uses Newton - most of the credit should still go to Walaber.

My Showcase - It's DBpro-tastic
Baggers
20
Years of Service
User Offline
Joined: 31st May 2004
Location: Yonder over dem dere hills
Posted: 24th Mar 2005 08:59
All hail Chris and Walaber...very nice work man, well theres no need for me to write a physics engine for 2d now !
Looks great im gonna love seeing what people do with this.
walaber
21
Years of Service
User Offline
Joined: 22nd Oct 2003
Location: Los Angeles, CA
Posted: 24th Mar 2005 15:07
Chris, that is really, really cool!!

I have a few quick questions about your code..



why do you disable the AutoFreeze? letting objects freeze is important to keep the framerate up...

also, I'm surprised you get reliable results setting the inertia to 0,0,0... I think you should use the helper functions to calculate the intertia based on the x/y size...

fantastic idea though!!!

Go Go Gadget DBPRO!

Athlon XP 2400+ || DDR-SDRAM 1GB || Nvidia GeForce 4 Ti4200 AGP 8x 128MB
Chris K
21
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Lake Hylia
Posted: 24th Mar 2005 16:22
If I set Autofreeze on, it seems to muck up the explosions, which are by far the coolest part. I don't know where I picked up the habit of switching that off, did it used to be permanent in an older version of Newton? I thought it meant once they stopped moving they never moved again.

I also get weird results if I calculate inertia, I've changed it to 1, 1, 1 and there don't seem to be any adverse effects at the moment. Thing is, it can only rotate on one axis so there's not really any point. It's mainly for things like poles in 3D where they obviously roll better one way.

I have updated it a little bit, it's a little more stable now.

----------

Something weird is happening though - if I just run the program it runs at 35FPS, if I run it with fraps running (but not doing anything) it runs at 60FPS!

My Showcase - It's DBpro-tastic
Vues3d on Kalimee
20
Years of Service
User Offline
Joined: 12th May 2004
Location: NYON (SWITZERLAND)
Posted: 24th Mar 2005 17:35
This is a really excellent Plug!!!!!!!!!!!!!!!!!

Guido
http://www.vues3d.com
walaber
21
Years of Service
User Offline
Joined: 22nd Oct 2003
Location: Los Angeles, CA
Posted: 24th Mar 2005 18:35
Quote: "If I set Autofreeze on, it seems to muck up the explosions, which are by far the coolest part. I don't know where I picked up the habit of switching that off, did it used to be permanent in an older version of Newton? I thought it meant once they stopped moving they never moved again."


that's an easy fix. leave the AutoFreeze on. then when you go to set an explosion, and you loop through the bodies, just do this:

if NDB_BodyActive(bodynum) = 0
NDB_NewtonWorldUnFreezeBody bodynum

...and then continue to add the forces. those commands let you know if an object has "fallen asleep", and let you "wake it back up". will make it MUCH more efficient.

I personally think setting the inertia to proper values is still a good idea, because it will make long, skinny boxes act different than cubes, and oblong oval shapes will roll more realistically. plus the mass also has an effect, so heaver objects will "feel" heavier because of the way they rotate as well.

by the way, the videos are really cool!!

Go Go Gadget DBPRO!

Athlon XP 2400+ || DDR-SDRAM 1GB || Nvidia GeForce 4 Ti4200 AGP 8x 128MB
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 24th Mar 2005 19:04 Edited at: 24th Mar 2005 19:05
Quote: "He saw beans lots of beans lots of beans lots of beans yeah..."


Every body loves magical Chris Knott, because the plugins he makes are ever so clever...

Looks a cool plugin Chris. Although if I ever made a platformer, I'd be inclined to do it in 3d with planes.

But, still very cool! Reminds me of Viewtiful Joe.

Seeing as everything else physics related is stickied...

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 24th Mar 2005 21:15
V. Nice!

Great job with that, Chris.

I had an idea a little while ago, while playing with a small 2D game to do the exact same thing, but never actually did it. It's great to see that it's been done, though

Quote: "2D is the new black."


mate, 2D was never unpopular !


Team EOD :: Programmer/All-Round Nice Guy
Aust. Convention!
Chris K
21
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Lake Hylia
Posted: 24th Mar 2005 22:53 Edited at: 24th Mar 2005 22:55
Yeah, but it hardly tops the charts... until now
We're bringing it all back home.
Vive le resistance!

Think about it - Windows is going 3D, something needs to balance it out.

Going 2D is by far the easiest way to make professional looking games, I learnt that at the last compo.

Tom Fulp (who runs Newgrounds) said about his game - "Alien Hominid is everything 2-D games would have become if the world hadn't been seduced by 3-D,". Alien Hominid started as a flash game and now its on Gamecube + PS2, that should be a real inspiration for indie developers everywhere.

Everyone forgets that all the advancemences in gaming ( multiplayer, physics, shader cards etc.) can apply to 2D as well.

I wish more people in DBPro would make 2D games - they're always so good (like all fog's games). To make something look amazing in 3D you need $5,000 (or $50,000,000 if you're Valve) - to make something look amazing in 2D you need Paint.

Some awesome 2D games everyone should check out:
- http://www.chroniclogic.com/index.htm?gish.htm
- http://www.mapleglobal.com/
- http://www.alienhominid.com/

My Showcase - It's DBpro-tastic
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 25th Mar 2005 00:46
My current project is 2D. I spent 4 to 5 hours putting the graphics together, which would have been 4 to 5 weeks for 3D objects. Even if I say so myself, it's looking far more professional than any of my 3D stuff.

BatVink
Chris K
21
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Lake Hylia
Posted: 25th Mar 2005 01:07
That's exactly what I thought when I made Tankoids!!

I was like... "Crap! Did I make that?!?"

It's so much more fun as well! The maths never gets any harder than trig.

Except animations... they suck.

I can't wait til the 2D enchancement pack comes out - hopefully they'll make a 2D animation system with play sprite.

My Showcase - It's DBpro-tastic
Ron Erickson
Moderator
21
Years of Service
User Offline
Joined: 6th Dec 2002
Location: Pittsburgh, PA, USA
Posted: 25th Mar 2005 01:09
This looks really, really cool. GREAT idea Chris!

Once things settle down for me a bit, I'll be checking this out further.

-Ron

EZrotate!
Tokamak Physics Wrapper!
Hawkeye
21
Years of Service
User Offline
Joined: 19th Sep 2003
Location: SC, USA
Posted: 25th Mar 2005 03:58 Edited at: 9th Jul 2005 01:42
Where's meh bang.bmp for teh second demo???

Other that that (I ended up making a replacement in paint) this is REALLY REALLY cool--keep it up! THIS IS FREAKIN' AMAZING!!!!! Totally awesome, I may just toss that 1200+ lines project for a 2d version...



EDIT: while everybody's waiting for the movement functions, I made two quick ones:


AddImpulse( Object#, xPos#, yPos#, Force# ) works like you'd expect--virtually like the explosion thingee only it only effects one object

GlobalForce( Object#, xForce#, yForce# ) also works like you'd expect, if you've ever experimented with newton--it adds a single force to a single object using values for x/y.

Keep in mind that I HAVE NOT tested these functions, and probally won't until later (I have to head to town in about 15 minutes and I'm not ready ) They may or may not work...




EDIT 2: awww crap they don't work... well never mind (great now I'm going to be late )

[edit for sig see page 3 for explination]
Chris K
21
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Lake Hylia
Posted: 25th Mar 2005 05:52
Almost finished the player control stuff.

Glad you like it.

My Showcase - It's DBpro-tastic
Jeku
Moderator
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Vancouver, British Columbia, Canada
Posted: 25th Mar 2005 06:50
Chris, this is great! I was just over on the other forum asking for somebody to please make a 2D physics plug-in! This will be great for my Incredible Machine game I'm working on Thanks!!!!


--[GameBasic - Coming Soon]-- ^^^ banner generously designed by TheBigBabou
Chris K
21
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Lake Hylia
Posted: 25th Mar 2005 07:15 Edited at: 25th Mar 2005 07:22
Thanks.

I've added the player control and a new demo and updated the media.

Have fun.

-------------

Woot! Got into the newsletter!

My Showcase - It's DBpro-tastic
Hawkeye
21
Years of Service
User Offline
Joined: 19th Sep 2003
Location: SC, USA
Posted: 25th Mar 2005 09:21 Edited at: 9th Jul 2005 01:42
Oooo, nice... Funky character drawing Methinks I may finish that 'easter-bunny-saving-eggs-from-flaming-zombies' game before Sunday yet

I really should comment on the quick update--he said he'd put in char control, and he did! Remarkadbly speedy if you ask me (certainly above adverage for teh typical programmer )

EDIT: err, err, how am I supposed to have more than one player object? All you've got is... player How about a array or something where you can keep all of the player dudes in, so say you want to make player #8 run to teh right, then:
p(8).movement=5

Makes a little more sense than player(1)=5 (unless you used constants of course)

[edit for sig ]
Chris K
21
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Lake Hylia
Posted: 25th Mar 2005 15:59
Yeah sure. I'll do that now.

My Showcase - It's DBpro-tastic
Chris K
21
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Lake Hylia
Posted: 25th Mar 2005 16:24
Ok.

I've updated it.

Now you have to specify a player number when you use the player commands.

So to move players you say:
Players#( 3, 1 ) = 7
Players#( 2, 1 ) = -10

That will move Player 3 to the right and Player 2 to the left.

My Showcase - It's DBpro-tastic
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 25th Mar 2005 18:02
Chris, do you knwo of any good places where you can get 2d characters? I'm couting with teh idea of a 2d game but as I'm awful at drawing, I was hoping there'd be some online repository.

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
Chris K
21
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Lake Hylia
Posted: 25th Mar 2005 19:36 Edited at: 25th Mar 2005 19:55
I just found these:
http://www.vbexplorer.com/VBExplorer/charpack1.asp
http://www.gamedev.net/community/forums/topic.asp?topic_id=272386

This is cool:
http://www.panelmonkey.org/category.php?id=1

It's got all the Doom sprites.
You could make Doom 3 but in 2D

They're a good size for a platformer running at 800x600

--------------------

Fairly big update.
I made a simple World Editor for setting up the static objects for your level.

Check the first post!

My Showcase - It's DBpro-tastic
Hawkeye
21
Years of Service
User Offline
Joined: 19th Sep 2003
Location: SC, USA
Posted: 25th Mar 2005 21:54 Edited at: 9th Jul 2005 01:42
Failing that, make a stick game Like stick soldiers/2 (that game rocks!) Stick men, frag men, oh look, blown to pieces...



Thanks for teh update, Chris--I'll take a look at it when I can (probally this afternoon) Looking great tho


[meh.. sig!]
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 25th Mar 2005 23:50
Thanks Chris, I remember vbexplorer from my old beginner days, it's all coming back to me now

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
fog
21
Years of Service
User Offline
Joined: 5th Oct 2003
Location: Newcastle, England
Posted: 26th Mar 2005 01:07
Wow that's superb Chris.

Must have a play with it sometime and maybe I'll make us a nice new intro

Really really impressed.

Chris K
21
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Lake Hylia
Posted: 26th Mar 2005 04:03
Cheers.

I found the original Mario sprites so I decided to make a Mario game.

Here a video

My Showcase - It's DBpro-tastic
Hawkeye
21
Years of Service
User Offline
Joined: 19th Sep 2003
Location: SC, USA
Posted: 26th Mar 2005 04:35 Edited at: 9th Jul 2005 01:43
Haha, looks like a great remake!

A problem--I can't get teh level editor to work. Each time I hit ctrl+s, after I enter teh filename it crashes saying "error at line 117--the file name is invalid at line 117" Interestingly enough however, it works if I only put in one collision thingee and run the app by clicking on editor.exe, not via the f5 button

This is doubley infurateing because I swore to myself I'd finish that easter bunny vs. zombies game by Sunday! The rest of this afternoon is to be spent in Augusta, so Saturday is really my only hope..

My media parts are attached to this post (only 1k), and the sprite code segment is below:


Everything else stayed teh same, except for a 'set display mode 1280,1024,16' command at the top of the program (otherwise, at my display res, you couldn't scroll to the right or down )


[edit... sig again... ]

Attachments

Login to view attachments
Kjelle69
20
Years of Service
User Offline
Joined: 5th Aug 2004
Location: Sweden 150 km north of arctic circle
Posted: 26th Mar 2005 04:40
Great Job !!!
This plug fills a very needed gap !

More Newton to the people !
Chris K
21
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Lake Hylia
Posted: 26th Mar 2005 05:04
Maybe you can't have spaces in the filename.

I try and find out what's going wrong.

There's a new version of MakePlayer() coming that allows animation.

My Showcase - It's DBpro-tastic
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 26th Mar 2005 07:39
Chris, that mario movie in sublime. Fantastic even. How long did it take you to get to that point?

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
Osiris
20
Years of Service
User Offline
Joined: 6th Aug 2004
Location: Robbinsdale, MN
Posted: 26th Mar 2005 14:57 Edited at: 26th Mar 2005 14:57
This would be great, if I had DBP, or Newton ... someday tho...someday.

aristid
22
Years of Service
User Offline
Joined: 29th Oct 2002
Location:
Posted: 26th Mar 2005 14:57
beautiful!
aristid
22
Years of Service
User Offline
Joined: 29th Oct 2002
Location:
Posted: 26th Mar 2005 15:29 Edited at: 26th Mar 2005 15:32
uh, forgetit, I was asking for the media.
imagine my programming.
like I said, excellent.
bullets are next!
Chris K
21
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Lake Hylia
Posted: 26th Mar 2005 16:25
The Mario thing didn't take that long at all.
I'll be releasing it as a code demo when it's a bit more done.
The sprites were the hardest thing to find.

I'll upload the new MakePlayer() thing now.

My Showcase - It's DBpro-tastic
dj chainz
20
Years of Service
User Offline
Joined: 25th Sep 2004
Location: England
Posted: 27th Mar 2005 00:39
This is great - I never thought that you could convert Newton to 2D very well. One question, as I do not know much about newton, is there a way to detect when an object hits another - this would be excellent for sound, which everyone seems to forget!

I am the lead programmer at red spark studios
http://www.brazilianhotties.tk
Hawkeye
21
Years of Service
User Offline
Joined: 19th Sep 2003
Location: SC, USA
Posted: 27th Mar 2005 00:47 Edited at: 9th Jul 2005 01:39
There is a (somewhat) complicated way with newton, yeah, but why not use:
< Return Integer=SPRITE HIT(Sprite Number, Target Sprite Number) >
or:
< Return Integer=SPRITE COLLISION(Sprite Number, Target Sprite Number) >
with the sprites in question. For sfx and the like this is OK, but if you need to detect collision for, say, a explosive bullet or something that will cause effect on the newton object, you'd better find out how to do it in newton *inhales sharply*

So if you want a groundhit sound for when the player hits the earth, you'd use something like in your main loop:

Presuming that your player sprite is 5, earth sprite is 1000m and snd_Groundhit is pointing towards you 'oof' sound



EDIT: grrr... what's with the gymnastics effect??? The image keeps flipping for no reason Vid attached to the post (400+ k)

[edit for sig see page 3]

Attachments

Login to view attachments
Chris K
21
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Lake Hylia
Posted: 27th Mar 2005 02:20 Edited at: 27th Mar 2005 02:23
Yeah, I found that problem.

It's because Newton only allows 1 UpVector per object.

Here's the newest version of Fizz.dba:



That should fix it.

MakePlayer() is slightly different now.

You need to set the image number by setting Players#( 1, 5 ).

So this:
Players#( 1, 5 ) = 11
will make Player 1 use image 11. This means you can have animation.

You also need to specify an xOffset and yOffset because character are often weird shapes where the centre of the body isn't the centre of the image.

----------------

Try to use bigger objects.
40 pixels is really the limit (although Mario is 32)

My Showcase - It's DBpro-tastic
Hawkeye
21
Years of Service
User Offline
Joined: 19th Sep 2003
Location: SC, USA
Posted: 27th Mar 2005 03:36 Edited at: 9th Jul 2005 01:40
Ah thanks for the update - gymnastics problem fixed! Thanks for the set image thingee too--now my bunnies can face each other while they blast away with teh '2-gigahurtz megaowie matter inference implosion beam transfer device... thing'

Phew.. five hours of coding done, and it's 1:30 pm. Looks like I'll finish this project in time for easter after all. %100 of the credit goes to you however--without your frequent updates, I'd be stuck in the rain




edit: ok new bug--in the player control demo, if you hit enter to make the crates after two crates it quits saying "error at line 109--object already exists"


edit 2: what would I have to set using newton commands in order to manually reposition a fizz object? Cuz I need to respawn those bunnies and I can't exactlly use move sprite to do it ^_^


edit 3: a screen of the bug in the first edit:

interestingly enough, it changed! Wierd...

edit 4: methinks I need to stop editing


[edit for sig ]
Chris K
21
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Lake Hylia
Posted: 27th Mar 2005 06:51
When you make a crate you have to give it a sprite number, you must be giving it the sprite number for the floor or one of the bunnies.

Here's a little function for positioning it (untested):


My Showcase - It's DBpro-tastic
Baggers
20
Years of Service
User Offline
Joined: 31st May 2004
Location: Yonder over dem dere hills
Posted: 27th Mar 2005 09:11
http://www.indiegamejam.com/igj2/games.html
Its from a while ago but could give some interesting ideas...check out stunt hampsters, that rocks !
Hawkeye
21
Years of Service
User Offline
Joined: 19th Sep 2003
Location: SC, USA
Posted: 28th Mar 2005 00:53 Edited at: 9th Jul 2005 01:40
No go on the position function, I get a "Paramenter mismatch in command NDB_SetMatrix at line 125" which is this line:


Crate problem fixed... can't belive I made that mistake Well blame it on using sprites instead of object, eh? New to this 2d stuff... Andway, I ended up using a FindOpenSprite() function like this:


Thanks for your all your help, Chris This really is a useful little set of functions, and you're posting them here really is a nice thing to do.

(grgh now I've only got about 2hours of coding time for this thing)

[edit for sig ]
Chris K
21
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Lake Hylia
Posted: 28th Mar 2005 01:04
Oops, wrong way round on the BuildMatrix + wrong secong command.

I should be this:



My Showcase - It's DBpro-tastic
Hawkeye
21
Years of Service
User Offline
Joined: 19th Sep 2003
Location: SC, USA
Posted: 28th Mar 2005 01:11 Edited at: 9th Jul 2005 01:40
Wow that was a fast response ty, this should help alot with blood fx + zombie respawn

[edit for sig ]

Login to post a reply

Server time is: 2024-11-23 14:11:34
Your offset time is: 2024-11-23 14:11:34