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.

AppGameKit Classic Chat / Isometric tennis ball physics

Author
Message
hoyoyo80
8
Years of Service
User Offline
Joined: 11th May 2016
Location:
Posted: 13th May 2016 04:21 Edited at: 13th May 2016 05:01
Hi all. Im coming from blitz3d community and Mintoris Basic(Android Only).

Im not very good at programming but i do finish some silly game on blitz3d(3D) and apps on Mintoris Basic.
Now im interested on creating 2d game and really want to remake a classic NES Tennis Games as in pic. My question is on how to achieve Isometric ball movement in this view(unlike top view pong game)?Thanks

Attachments

Login to view attachments
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 13th May 2016 07:08 Edited at: 14th May 2016 01:10
Welcome.
The simplest way to achieve this is to use 3D, then the angle of the display does not matter.
If you want total control of the ball in order to make a retro style game rather than realistic simulation, you can do it without physics.
There is a recent thread in this board about Isometric movement.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 13th May 2016 08:54
It is possible to set the FOV of the camera real narrow, then move it back a lot, which will mimic a isometric view by reducing the 3D effect. That way you could use 3D but maintain a retro 2D look, much like Crossy Road and other retro arcade games. That's what I would do if making a retro isometric game, using 3D has so many advantages, compared to 2D isometric with the Z depth issues and having to draw sprites... much easier to use 3D and 3D models.

I would say though, it can be difficult to use 3D physics without properly using 3D physics... like if you are making it to be just like the original, then maybe making your own physic system would be better, you'd have full control, and it might just be keeping track of a balls velocity and position, and adjusting that based on collisions. If you use proper Bullet physics, then it kinda changes the nature of the game, instead of an arcade tennis game the physics would be more realistic. Of course that can be equally effective, but it might end up changing the gameplay a great deal. Personally I think that remakes should concentrate on visuals and leave the core gameplay intact as much as possible. I would use traditional vector movement for the ball, because doing it with proper physics might mean you spend more time and code just wrangling physics to behave like an arcade game. You don't need to use full physics to use object collision detection, especially when there's commands to do point to point raycast checks with a radius - so it would be easy to have perfect ball collision detection regardless. In short... proper physics systems can be like herding cats... so many parameters that you have to abstract and then end up having to take control over - it is by no means the easy option.

Anyway, I'm sure you'll get right into AppGameKit - it's a wonderful language, and there's always advice here when you need it. It's not really much like Blitz at all, it should take very little time to learn what you need to make your game, and being able to deploy straight to android and ios devices is simply awesome... it makes developing mobile games so much more fun.
hoyoyo80
8
Years of Service
User Offline
Joined: 11th May 2016
Location:
Posted: 13th May 2016 11:00
Reading both of the comment make lot of sense to me. Thanks.It is practical to use plane mesh and texture it with animated texture in AppGameKit to act like 2d sprite??(I havent go through 3D yet)

Thanks
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 13th May 2016 11:54
This is an actionscript tut for fake 3D.
https://www.kirupa.com/developer/actionscript/3dexplore.htm

The equation however is very simple and non-specific;


focalLength is the distance from your eye to the camera plane. I wouldn't worry about it too much right now. make it a lowish number, 10 maybe. Changing this is in effect changing your lens length (Fish eye or very flat like the cricket/tennis on TV)
WorldX/WorldY/WorldZ are the 3d World co-ordinates
FlatX/FlatY are the 2d co-ordinates used to plot your point (or sprite)

You can also multiply you sprites x/y scale by the scaleRatio so that it scales according to it's z position
hoyoyo80
8
Years of Service
User Offline
Joined: 11th May 2016
Location:
Posted: 13th May 2016 14:56
Hi..thanks for the reply...the article u post can be studied more by me.I understand the concept
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 11th Jun 2016 05:57
I know you've moved on to the 3d commands with this one but i had a few hours and i thought i'd try to implement the fake 3d equation so here it is (see attached). The app simply draws the outline of a plane
Couple of things to note;
All 3d co-ordinates are relative to the camera -100x is to the left of the camera 100x is to the right -100z is in front of the camera and 100z is behind. -100y is below the camera and 100y is above
The equation will give you a numbers where 0,0 is the camera so in order to move the camera to the middle of the screen i need to SHIFT the resulting 2D number by half the screen width and height
I also SHIFT the 3D y co-ordinate so i can simulate the camera moving up and down.
I also SCALE all the co-ordinates up by a value (which you really don't need if your original co-ordinates are to scale but it makes a good ZOOM effect)
There are 3 sliders that allow you to adjust ;
The viewpane (goes from a fish eye to a more iso)
The height of the camera
The scale of the scene

Attachments

Login to view attachments
hoyoyo80
8
Years of Service
User Offline
Joined: 11th May 2016
Location:
Posted: 13th Jun 2016 16:21
Wow! Thats very kind of you...i will learn from it and see how its work for future project

Login to post a reply

Server time is: 2024-09-29 15:23:51
Your offset time is: 2024-09-29 15:23:51